Connecting two GameObjects

I have two GameObjects, one is the player which is a red cube in this instance and the other one is a thruster. I want to attach this thruster to the player but parenting and using joints doesn’t work. When I use the fixed joint the GameObjects acts erratically and with parenting they pop out of each other…

Any suggestions?

1 Answer

1

Hello Magnus00107,

What about ParentConstraint component or just a PositionConstraint? this would stick the two elements together instead of a joint and you could also define a breaking event by yourself (for example with a collision velocity threshold)

Another way would be to apply the rigidbody.velocity of the thruster to the player’s Rigidbody while they are considered attached in order to avoid solely relying on the physics engine (remember doing that in the FixedUpdate method)

Hope it helps