How to make the character affected by gravity? (SOLVED)

#1

So, I have a character that has a collisionobject on it which is kinematic. My understanding is that kinematic objects aren’t affected by the physics (like gravity) but I want my character to be affected by it. Do I need to make the gravity especially for him in his script?

0 Likes

#2

Yes, you need to apply gravity in the player script. You do this usually from the update() function (remember to use dt/delta time).

1 Like

#3

Alright, thanks. I’ll try to figure that out

0 Likes

#4

Typed on my phone:

function update (self, dt)
  local pos = go.get_position()
  pos.y = pos.y + 600 * dt
  go.set_position(pos)
end
0 Likes