0 votes

I want to have the force or last velocity that the player hit the ground, so if the fall is higher, the impact is bigger.
My objective is apply a camera shake (already set up) based on the impact force, and maybe some animations

asked Jun 20 in Projects by BrunoFreezee (78 points)

1 Answer

0 votes

A kinematic body's velocity is set by you, so when you detect a collision with the TileMap, check what your body's velocity variable is.

answered Jun 20 by kidscancode (16,966 points)

I tried with area2d, for example, when body enters: print (motion.y)
sometimes it prints 0, sometimes a velocity, so i think this is not the better way to do it, or i'm doing it wrong

Well, an Area2D should have nothing to do with it at all. When your kinematic body collides, it will report the collision.

I suggest reading this: https://docs.godotengine.org/en/3.2/tutorials/physics/using_kinematic_body_2d.html

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.