What is the issue with "Spring Module"

Hi, currently i want to know everything about the springs as far as I know, springs are an alternative to Tweening, so I want to understand how to use them in Roblox.

  1. What do you want to achieve? To understand how to use the spring module

  2. What is the issue? The main issue is that i can not solve the spring issue

  3. What solutions have you tried so far? Nothing yet

For instance, I created the function which should create a spring for this “bumping anim for frame”, everything that i got so far is issues with that:

function in the module section:

function GuiModule.closeParentFrame(screenGui: ScreenGui)
	local openState = false
	
	for _, frame in ipairs(screenGui:GetChildren()) do
		if frame:IsA("Frame") then
			if not openState then openState = true end
			
			local spring
			if openState then
				spring = FrameSprings.buttomSpring(1, 5, 5, 1.5, 10, 0.5)
			else
				spring = FrameSprings.buttomSpring(1, 5, 5, 0.5, 10, 1.5)
			end
			
			runService.RenderStepped:Connect(function(dt)
				local pos = spring.Position
				local offset = UDim2.fromScale(pos, 0.5)
				frame.Position = offset
			end)
		end
	end
end

photos:

first one is when i clicked and the second one is when i closed it:

I hope someone wiil help mee, thanks (^- - ^-)

There are a few things wrong with your script.
First is that you are Making a new RenderStepped connection for every frame! You can change it to make one connection that will update every frame.

RunService.RenderStepped:Connect(function(dt)
for _, frame in ipairs...
end)

You need to make sure to save that connection as well so that you can disconnect it later.

About the springs, I would need to see the spring module you are using, but I assume that it is because the spring is never updated. You initialize it here (also it is spelled wrong buttom)

but you never update it later.

Can you send your spring module?

um, okay. So the Spring module i picked up the classic one like this one like wwhen to write in toolbox Spring Module by nickname starts from k… like a base (i can not show right maybe u know)