guix Posted January 22, 2013 Share Posted January 22, 2013 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
Lloyd Logan Posted January 22, 2013 Share Posted January 22, 2013 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
guix Posted January 22, 2013 Author Share Posted January 22, 2013 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
guix Posted January 22, 2013 Author Share Posted January 22, 2013 How are rotations useful in my case? Link to comment
Jesseunit Posted January 22, 2013 Share Posted January 22, 2013 How are rotations useful in my case? Perfect example: https://wiki.multitheftauto.com/wiki/IsVehicleOnRoof Link to comment
guix Posted January 22, 2013 Author Share Posted January 22, 2013 Please read the first post, or just the topic title. I don't need this, I was just answering to his weird, indiscrete question... Link to comment
Jesseunit Posted January 23, 2013 Share Posted January 23, 2013 Please read the first post, or just the topic title. I don't need this, I was just answering to his weird, indiscrete question... Use getElementDistanceFromCentreOfMassToBaseOfModel Link to comment
Blaawee Posted January 23, 2013 Share Posted January 23, 2013 maybe : getGroundPosition and check this : https://community.multitheftauto.com/ind ... ls&id=6122 Link to comment
guix Posted January 24, 2013 Author Share Posted January 24, 2013 Use getElementDistanceFromCentreOfMassToBaseOfModel I have tried with this before but it doesn't work very well (especially when vehicle is upside down ) maybe : getGroundPosition and check this : https://community.multitheftauto.com/ind ... ls&id=6122 It's what I used in 3rd post, It's what I use in my script for now, until I make a proper fix to be very accurate with all vehicle. Link to comment
Moderators IIYAMA Posted January 25, 2013 Moderators Share Posted January 25, 2013 You can also check the speed of the z as. speedx, speedy, speedz = getElementVelocity ( vehicle ) ( outputDebugString(speedz) /debugscript 3 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now