Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Implementing transition for my character picking up an object from the floor

Discussion in 'Animation' started by tHE_uKER, Nov 9, 2019 at 2:05 AM.

  1. tHE_uKER

    tHE_uKER

    Joined:
    Oct 19, 2019
    Posts:
    16
    I need to have my 2D character pick up an object from the floor, and lift it above its head, being able to carry it.

    I have figured out that setting the object's transform.parent to my character's transform achieves the effect of the object becoming fixed to it. Then I adjust its transform.localposition to move it above the character's head and presto!

    The problem is the transition. If I parent the object to my character first, its coordinate frame changes, and it momentarily disappears to who-knows-where. Then I change the coordinates to something near the origin, and the object comes zooming in back to being close to the character.
    The sequence of events happens very similarly if I adjust the coordinates first and change the parenting later.

    My goal is simply getting the object to move in a straight line at constant speed from its initial position on the floor to a location near my character's hand.

    What's you guys' advice on how to implement this?

    Thanks in advance.
     
    Last edited: Nov 11, 2019 at 4:03 AM
  2. tHE_uKER

    tHE_uKER

    Joined:
    Oct 19, 2019
    Posts:
    16
  3. tHE_uKER

    tHE_uKER

    Joined:
    Oct 19, 2019
    Posts:
    16
    Wow, I'm overwhelmed.