Baseplate Posted January 14, 2014 Posted January 14, 2014 If you are flying in the air, I want to get the difference between the ground's Z position and my Z position, any possible way to do it?
Spajk Posted January 14, 2014 Posted January 14, 2014 https://wiki.multitheftauto.com/wiki/GetGroundPosition If you are really high in the air, there's a chance this function won't work. What do you need it for, there might be a better way. EDIT: CrystalMV was faster
Tete omar Posted January 14, 2014 Posted January 14, 2014 I think he already got the Z value from getGroundPosition, but he wants the difference between his Z level and the other one ( the distance ), So try using this function: getDistanceBetweenPoints3D
Spajk Posted January 14, 2014 Posted January 14, 2014 I think he already got the Z value from getGroundPosition, but he wants the difference between his Z level and the other one ( the distance ), So try using this function: getDistanceBetweenPoints3D There's no need for that. local distance = playerZ - groundZ
Moderators IIYAMA Posted January 14, 2014 Moderators Posted January 14, 2014 Correct, except it can also be negative. local distance = playerZ - groundZ if distance < 0 then distance= -distance end (0 if the point you tried to test is outside the loaded world map)
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