#help a dumb guy with delta and _physics_process
1 messages · Page 1 of 1 (latest)
like let's say i multiply something in physics process by delta vs don't multiply it what would the difference be
ye, use the given delta that's passed into the function
so i do need to use it
then what's the difference between physics process and process
you said it yourself. Physics runs at a fixed rate
then why do i need delta for it
there was a good godot doc about it all let me see if I can find it
alr
https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html
A lot of it is explained in there
In game development, you often need to know when two objects in the game intersect or come into contact. This is known as collision detection. When a collision is detected, you typically want somet...
that's one thing godot is good at vs unity. Good documentation lol
alr tyvm i'll check it out
oh i see it's to prevent it slowing down due to lag alr
and not to prevent it from speeding up if it runs fast
the idea is you're promised that the physics will update a number of times per second (50-60), but that doesn't mean it's completely consistent which is why you still need to use the delta
yea i see\
You use the delta in the same exact case you would use the delta in the physic process, i will explain for you how it works
So say you want to move a character in the process function,
If you want to move him to the left by 1 pixel evey frame
If your pc goes to 60 FPS you character moves to the left by 60 pixel in a second
Say your pc goes to 120 FPS your character would move by 120 pixel to the left every second
So
1pixel * 10 FPS = 10 pixel per second
1pixel * 60 FPS = 60 pixel per second
1pixel * 120 FPS = 120 pixel per second
Now the delta is:
The time elapsed since the previous frame, aka 1/FPS
So
1pixel * 10 FPS * 1/10 FPS = 1 pixel per second
1pixel * 60 FPS * 1/60 FPS = 1 pixel per second
1pixel * 120 FPS * 1/120 FPS = 1 pixel per second
That's how you use it, for things that are dependent of the framerates
yea i know that
Now if it's fixed doesn't mean it's not gonna drop framerate, so you would still need to multiply by delta