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

in Projects by (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.

by (18,203 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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories