Detect when falling

Hello I’m just trying to detect when my character is falling at a rapid rate maybe from a high place. I tried searching it up but the forums/threads I read were to check if the character was grounded or not for jumping. I’m trying to detect when I player has fallen off something high and is falling down rapidly. I was thinking of doing rigidbody.velocity.y <= some value but I’m not sure if falling bodies in unity accelerate/increase speed when falling. Would appreciate some feedback. Thanks!

Hi ! I just did some quick tests and this is what I’m suggesting.

First, you want to create variables in your script that will reference the rigidbody of your character and the value of its velocity.

You want to store the value of your character’s velocity in a variable, and maybe make it public so you can check it from the inspector.

Here’s what the code would look like :

158583-rb.png

If you want to check if the value goes above a specific treshold, simply add an if statement like this ;

Hope it solves your question !