Delta and Movement

Hello,

Why is delta only applied to gravity and not to the other movement forces?

If i remember correctly in this project we are using direct movement so we are not using the physics system to move whereas gravity uses the physics system and so need the delta to be applied to avoid frame rate issues.

Sorry, dont know how i missed this one.

if for instance, if we set velocity.y to just GRAVITY and not multiply it with delta for now.
once we have a movement vector, using move_and_slide() uses delta for us behind the scenes, so we dont have to account for it manually and makes our movements based on the drawn frames per second.

the slight change, as far as my understanding went, was that we are adding an acceleration for gravity, which is M per second ^2.

because move and slide only multiplies by the delta once, we need to multiply the gravity acceleration ourselves before move and slide multiplies it again.

this will give the Y movement as an accelleration and the left and right as a normal movement vector.

thats the way i understood it when its mentioned in the docs and other places when i was thinking the same,

3 Likes

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

Privacy & Terms