I have heard about the tick() function and deltatime being used in (i believe) runservice, but I never really understood what they meant.
I know tick() starts like a timer at one point in your timer, but I could never find a real use with it in actual scripts aswell as deltatime, so could anyone explain what they really do and what they are REALLY useful for?
tick() returns the amount of seconds since January 1st, 1970 at 12:00 AM (in the local time zone). This number is very big. Right now, it returns about 1,730,491,797.5604. That’s when computers started telling time!
deltaTime is the change in time. It can pop up in multiple places, but with RunService.RenderStepped, it’s going to return the amount of time it took to render the frame. It’s important to hook onto deltaTime somehow to keep things synced and accurate. For example, you don’t want to rotate a part a fixed value each frame. Instead, you should multiply the full change (per second) with the deltaTime. This will keep things synced no matter what the user’s framerate is.
Sure, I built an example using deltaTime and not using deltaTime.
The deltaTime example depends on the change in time per frame, while the Fixed example assumes the user is using 60 FPS. They’ve been doing it for years, so why change right?
When I change my FPS to 240, the Fixed example rotates a lot faster since the fixed value is being applied more than expected. With higher FPS, the deltaTime decreases which keeps the example rotating at the same speed.