Jump to content

isVehicleOnGround returning false for high vehicles


guix

Recommended Posts

Hello,

I have an small problem because isVehicleOnGround does'nt always work , for example with Dumper or Monster, it's most of the time returning false, only if for example I do a big jump and when landing the suspensions go down, so then it is true for a short time. I believe it's something to do with comparing distance from vehicle's mass center with ground.

What can I do?

Link to comment
Hello,

I have an small problem because isVehicleOnGround does'nt always work , for example with Dumper or Monster, it's most of the time returning false, only if for example I do a big jump and when landing the suspensions go down, so then it is true for a short time. I believe it's something to do with comparing distance from vehicle's mass center with ground.

What can I do?

What are you trying to do with this function?

Link to comment

I try to add a detection when vehicle is upside down, to make a "autoflip". I think I fixed it by replacing isVehicleOnGround by:

local fGroundZ = getGroundPosition ( fPositionX, fPositionY, fPositionZ )

if fPositionZ - fGroundZ < 3 then // vehicle is close to ground

Works very well but need to test more.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...