Making math.sin independent on frame rate

im using math.sin to simulate viewmodel sprint animation but whenever i run fps unlocker the results from math.sin are getting extreme

		local sin1 = math.sin(tick() * 1) /2

There’s two possible causes for this.
Either tick() isn’t real-time (speeds up/slows down according to framerate), or the Spring you’re using isn’t compensating for the framerate somehow.

Try replacing tick() with os.clock(), which is the time since the computer booted up.
I don’t remember what tick() was supposed to represent, but tick(), time(), os.clock() etc. aren’t all the same, be sure to pick the right one when you need a timer of some sort.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.