Einheit-101 Posted January 31, 2014 Posted January 31, 2014 Hello community. I have a question related to Vector calculation. I got 2 Objects with their X Y Z coordinates and i want to calculate a velX, velY and velZ from object 1 to object 2. I am still searching on the internet for a solution but i cant find what i want. Could anyone please help me with this problem? Mfg Einheit-101
50p Posted January 31, 2014 Posted January 31, 2014 Take away one object's X, Y and Z from another object's X, Y and Z. local x,y,z = getElementPosition( obj1 ); local x1,y1,z1 = getElementPosition( obj2 ); local yourVector = { x-x1, y-y1, z-z1 }; I hope that's what you want.
Einheit-101 Posted January 31, 2014 Author Posted January 31, 2014 Yes, my friend, thank you! This exactly does what i was searching for! Unfortunately “getVehicleComponentPosition“ does not return useful xyz values for the misc_c component, so i have to wait with my script until there is something like “x,y,z = getVehicleMuzzlePosition(theVehicle)“. I wanted to create a custom Rhino cannon, but it seems that CLEO is more advanced with vehicle scripting functions than MTA...
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