How to make player sprite object offset from child sprite object?

The child sprite is following the player sprite. When I press a key, I want the child sprite stop following the player for a few seconds. How do I do that?

It “follow” the player because its a child of it. To break this link, you need to unset the parent-child relationship.

something like

yourGameObject.transform.setParent(anotherTransform)

Get the child sprite, use Transform#SetParent(parent); and set it to null or some other object, then after 2 seconds, set it back to it’s original parent.

Thank you! Its for making the player able to jump in a 2D top down game. Just having issues with the shadow. Not quite sure how to make an offset and still follow the player.