#Running code at 60 Fps
1 messages · Page 1 of 1 (latest)
impossible
Depending on what it is you want to run you can use delta time to make up for lag
But if you're looking to always make it run at 60fps then yeah it's impossible
ok ):
also, in fact, if you strictly need 60 fps you may want to think of another way to do this, as you didn't say what are you trying to do
i wanna move alot of objects with tween but had the issue that tweeing onyl had limited function so i tried making my own Tweening with lerping but on key factor of tweening was it run at 60fps and i cant replicate it
** You are now Level 2! **
🤔 tween is just updating a variable each frame thats why if it less fps is so much less smoother and if its more fps it is so much more smoother, that doesn't say either why do you strictly need 60 fps
yes but, if i do hearthbeat the movement may be slower/ faster depending on the players fps
in that case you should use delta time, you can find resources on why and how you can use it
you are probably prematurely optimizing.
just use tweenservice.
it can handle hundreds of parts. you're good. prove a performance problem, like actually prove it, recording, benchmark stats, etc, and then consider optimizing it. not before.
heartbeat is fine, it gives you a deltatime parameter that is the fractions of a second between this frame and the last frame. it can vary over time, sometimes have lag spikes. totally normal. deal with it 
i tried using TweenService but there some stuff you cant do because it to tricky or will not work
changing the speed mid animation and need a custom easingstyle
well then use renderstepped if its on the client.
what if the players frame is below 60fps
if you really want to take it advanced
then deltatime will be greater than 1/60. handle accordingly.
i realize how obvious that sounds but, no, really, it really is that stupid simple of a solution.
):
there's no fancy tricky trick that magically interpolates between large time gaps in frames.
you have to make your own.
deal with it.
Well it worked thx for the help, i guess