Baseplate Posted January 14, 2014 Share 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? Link to comment
Spajk Posted January 14, 2014 Share 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 Link to comment
Tete omar Posted January 14, 2014 Share 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 Link to comment
Baseplate Posted January 14, 2014 Author Share Posted January 14, 2014 I got it now, thanks everyone. Link to comment
Spajk Posted January 14, 2014 Share 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 Link to comment
Moderators IIYAMA Posted January 14, 2014 Moderators Share 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) 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