Attach object to vehicle (Maths problem, not scripting)
#1

Hi!

I wrote a code that creates and object and edit it; then find the final position and the final position of a car, and subtstract these values in order to find the relative position of the object from the vehicle, so I can use these values in AttachObjectToVehicle.

When the vehicle is pointing north (0 degrees) these values work fine,

ObjectX - CarX, ObjectY - CarY, ObjectZ - Carz, Object Z Angle - Car Z Angle.

but not with the rest of angles, so I think that I need a function depending on the offset between the angles and the sin/cos.

Could you please help me on the code to use so I can adapt it to any angle?

Thanks and regards!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)