Parent to move with child?

Hi all,

I have a situation in my game where I’d like a parent game object to follow one of its child game objects. For example:

My player has a “grappling hook” that can be fired at any time by the player, and is a child of the player game object. When fired I want the player to move with the end of the rope. The end of the rope swings and moves with physics, and has a rigidbody and collider.

I realise the player object cannot be both the parent and the child, so i’m after some guidance.

I imagine the way to approach this, is when the grappling hook is fired, the player who was once the parent, has its transform.parent set to the grappling hook. When the rope is finished with, simply switch the parenting back to how it was?

Can anyone see any issues with doing this?

Thanks

Mat

That’s what I was going to suggest, yeah.

–Eric

Thanks Eric5h5,

It makes me very glad that I was thinking along the same track as the fountain of all Unity knowledge that is you sir!

Cheers

Mat