Missile Won't Attach as a Child of an Airplane. Why?

I have an airplane model that I want to attach a missile to. In the hierarchy, I have an airplane object with the motion script attached, and children to this are:

  • the airplane model hierarchy
  • a collider hierarchy
  • a weapons system empty

I dragged the missile prefab to the weapons system empty: this works when dragging the airplane around in the editor. But when the game is played, the missile just drops to the ground with its own gravity, separate from the airplane. What is wrong? Can this object not have a rigidbody?

I tried:

  • adding a joint
  • deactivating my missile script
  • using a standard game object instead of a prefab

However, the missile still wants to use its own coordinates instead of remaining attached to the airplane. I plan to detach the missile later when it must be shot.

The answer to this is that an object with a Rigidbody separates from its parent in Unity. This is Unity’s way of enforcing only one Rigidbody per hierarchy.

To connect two rigidbodies, use FixedJoint on the child GameObject.