I’m having a HUGE amount of trouble trying to do something that I thought was initially quite simple. Basically I have a ship, and I want to attach equipment to it. I would like to retain the individual collision properties on each object, and have the equipment rotate with the ship, as if it really is attached to it. The problem is that every time I try something, it screws something else up. Here’s what I’ve tried so far - can anyone give me some tips?
Attempt 1: AttachTo with no weld - the equipment just floats away in space.
Attempt 2: AttachTo with weld - the equipment is now attached. When I apply a torque it translates the ship as well as rotates it, so something funny is going on. What’s really odd is that the translation only happens with a -ve torque. If I apply a +ve torque then it rotates with no translation. I can see the center of mass has changed (even though the equipment has mass = 0). I changed it back using physx code to the original location, no difference. I tried setting the Inertia tensor also but same behaviour. I also tried creating a ApplyTorqueAtLocation() fn, and ran it on the center of mass - still getting a translation component.
Attempt 3: Tried turning off collision in the equipment by using OverlapAll - this actually seems to produce the desired behaviour, except that the equipment no longer blocks anything.
I’m starting to think that all of the problems are due to trying to attach something. Does anyone have any workarounds, or any other alternatives besides attach? Should I just not attach them and update their positions manually each tick?