Linear Velocity and gravity

I’m following a Unity tutorial for a platform game and I’ve found that they use blend trees to change animation based on y velocity.

image

This could work fine but I’ve found that the vertical velocity is very unstable, so I’m assuming that it doesn’t work at all like Unity does, it can be positive or negative also causing multiple contact events even when the player is not moving.

2023-03-08 11.15.46

My question, is there a way to mitigate this ?

I guess your point is that you got wrongyVelocity. Where does your yVelocity comes from? It should be set by yourself through AnimationController.setValue.

Velocity comes directly from gravity, I’ve set a collider and rigidbody to the node