Physics Based Spring Module V2.0

Should this still be used in 2024?

heck yeah

char limit

what? oh now i know :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients: :coefficients:
anyways i might use this module!
edit: oh and also if you look in the player module code you will find a spring module but i dont think its this one or is it?

I would wait until 2025, then see if it should be used then if so then yes

1 Like

yeah, definitely.

I’m absolutely in love with this module, and I use it almost everywhere where it is needed to be use.
Whenever I need a nice elastic simulation of harmonic motion, shake, smooth interpolation, or anything related to that - I use this awesome module.

utterly lovely, my recoils look almost as good as Weaponry!

So this doesn’t support Vector3??? Do I just make 3 springs independently?

1 Like

Yes, just make 3 springs: this is a common approach for physics modelling.

2 Likes

How can I fix the problem with different fps?
The thing is that the intensity of the spring affects directly on the fps, I tried multiplying offset by dt60, but it also did not help, after the setvelocity(numberdt*60), it also did not help me, the question, what am I doing wrong? :sweat_smile:

function CameraController:update(dt)
	local offsetX = math.rad(self.SpringX.Offset)
	local offsetY = math.rad(self.SpringY.Offset)
	local offsetZ = math.rad(self.SpringZ.Offset)
	--offsetX*dt*60 - like example
	local newCamCF = CFrame.Angles(offsetX, offsetY, offsetZ)
	self.Camera.CFrame *= newCamCF:ToObjectSpace(oldCamCF)
	oldCamCF = newCamCF
	
end

function CameraController:jump()
	--self.SpringX:AddVelocity(25*self.dt*60)
	self.SpringX:AddVelocity(25)
	self.SpringY:AddVelocity(0)
	self.SpringZ:AddVelocity(150)
end
1 Like

It depends on the settings you used for your spring. The spring module itself uses its own timer to figure out the offset of the spring. Multiplying by dt will not do anything, as the module should already be calculating its offset depending on its initial parameters. Make sure your initial parameters are correct. Try using the Desmos graph I made for changing the parameters!

i ran into the same issue with the module not being consistent across different FPS, im not using delta time at all like u said. 60 fps gets about a 4th of the effect that 240 gets. and i cant imagine changing the initial parameters would change this

I’ve answered this question a few times, check out this post: