Hello! I just wanted to start this post by saying that this is my first time posting on the DevForum so my apologies if this is in the incorrect category.
- Why was this even made?
I’ve been developing a first-person shooter the past few days and the biggest issue I had to come up against was FPS unlockers. It took me 2 days to find the fix and I don’t want anyone else to go through that so here, have an edited version of x_o’s spring module that works independently of the client’s FPS.
Usage wise the module is the same as the original.
-
You can create a new spring using the
Spring:Create(Mass, Force, Damping, Speed)
function. In case you don’t pass any values, the module will autofill them for you using defaults.
An example from my game:local rot_Spring = SpringModule:Create(5, 40, 10, 3)
-
You can “Shove” a spring using the
Spring:Shove(Force)
function, whereForce
can either be a CFrame or Vector3.
An example from my game:rot_Spring:Shove(Vector3.new(-ad_Y, -ad_X, math.clamp(-ad_X, rot_NegMax, rot_PosMax)))
-
To get the position from a spring you have to update it using the
Spring:Update(Delta)
function.
An example from my game being:rot_Vector = rot_Spring:Update(Delta)
-
In the event of you needing to change the mass of a spring, for example, you can do that by doing
Spring.Mass = Desired_Mass
You can get it here on my public release repo.