Search Unity

Animating an Object after picking it up

Discussion in 'Animation' started by Rextrus, Jun 28, 2022.

  1. Rextrus

    Rextrus

    Joined:
    May 29, 2022
    Posts:
    1
    Hi there,

    I am working in a 2D project with a player object which is supposed to simply pick up an item to hold it.
    I made it so far that you can pick it up by touching the object with 2DCollider and hold it using "SetParent".
    After picking up, the object is a child object of my player object.
    How do I deal with animations using both objects?
    I created an animation with the player object as parent. When i then try to play the animation, the pickable child object just won't move and in the animation it says "missing" on the child object's properties. The animations are in a animator from the player object. In the animation tab it works fine.

    What is the proper way to deal with those?

    Before "SetParent" in script:
    upload_2022-6-28_9-2-47.png

    After "SetParent" in script:
    upload_2022-6-28_9-3-28.png

    It still won't apply the rotation properties on the top Body properties. The bones work fine.