How to check if vehicle is in the air/on the ground? (Is Moving On Ground doesn't work)

I am making a rocket league-like game and I have made a jumping mechanic and I want to either… sense when its in the air, so it doesn’t jump when in the air. OR. Sense when it’s on the ground so it only jumps when its on the ground. I tried using a ‘Is Moving On Ground’ Node along with a Branch, But it always came out ‘False’ even if driving. So if there is any fixes for this:


or if there is any other way to do this.

any ideas?

Try using IsFalling node. If that doesn’t work u can also do it manually by using a line trace to the ground to check of the vehicle is higher than a certain distance.

Any suggested tutorial videos for the line trace?

Raycast to the ground… in ‘normal’ mode… raycast length to the closest object (which is the ground) should be more or less equal to the vehicle height (depends on the origin anyway)… the direction is also almost pointing downward - you cannot make it too rigid though.

I had a similar situation recently, I needed to know if a player was in the air, and if in the air for a certain amount of time (aka is falling for a time) then allow the the player to press the same input key as jump and activate a parachute, but still normal jumping as usual.

You will notice at the beginning of this macro “exe 5” that is coming directly from an input action jump (not shown in the pic), that is fed to a branch, and the condition is an and boolean, the two connections of the and boolean are a “get player controller” and "was input key just pressed (spacebar in my case) , also a boolean variable (freefall), if you want to see how I set that variable look here. Freefall MACRO posted by BizaaroGrodd | blueprintUE | PasteBin For Unreal Engine 4

Whereas I was using spacebar as jump key, you should just be able to add a pin to that and boolean and add another is input key pressed down (face button down?) to suit your needs for however many jump inputs you need.

You can check out the thread here. How to tell (in seconds) how long Is Falling is activated?

Came across this problem myself, trying to deactivate tire dust kickup when vehicle is in the air. If you are using the Chaos Wheeled Vehicle component there is a node you can use off the component called “Get Wheel State”, this will ask for a wheel index (if 4 wheels from 0-3, not going to tell you which is which as different setups might be set differently but in your vehicle setup it will tell you FR, FL etc and its order).
Then you pull off the struct return value and “Break Wheel Status”, here is a load of useful info regarding wheel status you may want, but the one that relates here is the first one “In Contact”. It’s a boolean value and works perfectly, I set a forloop of 0-3 getting the wheel index and then branched to set either active or not active based on that boolean.
Hope this helps someone that comes across this!

1 Like