Objects to follow each other, need to have rigidbodies

I Have an ObjectA that gets fired arross the screen. I do not want this object to spin because it contains invisible colliders that will act at hit markers and therefore act differenty depending on where it is hit, and I will need these colliders always facing the camera.

The visual part of this object I do want to have spinning. So I made this a separate object and called it ObjectB.

I set ObjectB to be a child of object A and they move accross the screen perfectly together.

The problem comes when I try to make OBjectB spin.

I can’t use the addtorque option because you can’t have two objects that are parent-child relationship both have rigidbodies.

I tryed just having the objectB spin by changing it’s transform.rotation but it doesn’t look right and I would love to use the addtorque and later on the addforce for something else I want to happen.

I read that you can use fixed joints to make two objects follow eachother and they both can have rigidbodies.

I have set this up but it isn’t working properly.

Both ObjectA and ObjectB are instantiated together in two lines of code. but when I run the game ObjectB frezzes at it’s spawn location and ObjectA does exactly what it is supposed to do.

Any thoughts?

You could do it without parenting. Set your ObjectB with a rigidbody, and fire this one across your screen. Then create a script for your ObjectA that will follow only the position of ObjectB (transform.position = objectB.position). I’m not sure if Update() comes after or before the Physic loop, so you might have one frame late or something. And for the facing the camera part, same script, transform.LookAt( Camera.main );