Gradient rotation speeds up every time

Using Roblox’s gradient rotation script:

local function spinGradient(deltaTime)
		local currentRotation = uiGradient.Rotation
		uiGradient.Rotation = (currentRotation + ROTATE_SPEED * deltaTime) % 360
	end
	connection = RunService.RenderStepped:Connect(spinGradient)

I’ve found a way to utilize that for a intermission system. Basically, as the intermission counts down, the gradient on the text rotates.

Unfortunately, every time a new intermission happens, the gradient rotation speeds up every time, making it faster. I’d like it to stay the same speed, but I really don’t know how.

Yeah, make sure to connection:Disconnect() events when a new intermission happens or else the code happens twice every renderstep.

1 Like

It does already. It still seems to go faster.

Actually, it seemed to just be my eyes playing tricks on me. This seemed to do the trick. Thank you!

1 Like