Hi, I’ve run across a weird problem lately which I’m unable to resolve myself.
My goal is to create multiple cars which each consists of 2 objects, front and back.
-The front and back are supposed to detect collision. (but different colliders!)
-The front isn’t suppose to be affected by physics, the back is.
-The front is also supposed to come of at a certain point, and then react normally to physics.
-The front part has to move perfectly with the back part until it comes of.
The thing is, I can’t figure out how. Solutions I’ve tried:
-
If I lock the child rigid body in local space(either with code or with the kinematic check-box), it will stop detecting collision with other child rigid bodies(other car fronts) in the scene.
-
If I remove the rigid body component but still lock the child into place, collision will look normal, but collision will not be detected.
-
If I make the front object a child with a rigid body, but without the lock, it will work properly, but obviously react separately to physics when compared to the parent.
Edit:
-
Two colliders with a rigid body as parent doesn’t work either, unless there is some way to differentiate between colliders by code, as both colliders send their data to the parent rigid body(whilst I aim to to have different effects on the back and front).
-
Two rigid bodies attached by a Fixed Joint almost does the trick, except that joints allow for some degree of movement between the bodies. Also joints require two non kinematic rigid bodies…which means the front will always be affected by physics…
I’m not sure what to do at this point… I’m thinking its not possible actually, as it would probably require collision of two kinematic rigid bodies…
Any tips or suggestions for alternative routes to the same result would be greatly appreciated!