Search Unity

NPC Pick up the phone

Discussion in 'Animation' started by AlStar, Feb 18, 2015.

  1. AlStar

    AlStar

    Joined:
    Feb 18, 2015
    Posts:
    1
    Hi guys, i'm working on a project in unity. At a certain moment during the game one of my NPC receives a phone call. I want that when the telephone rings the character automatically picks up the phone, brings it to his ear and after a little time he picks it down. I've created an animation in Blender that simulates the action of picking up the phone. Now, how can i make the NPC to interact with the telephone on the table, take it in his hand and then put it down in the "almost" right position?

    P.S. I'm using Mechanim in unity

    Thank you for help :)
     
    Last edited: Feb 18, 2015
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey Al - I don't know if you've figured out a solution yet. If not here are a couple suggestions.
    Back in the old days this would be "faked". The character would already have the phone parented to his hand but it would be invisible. There would be a duplicate of the phone on the table that was visible. At the exact same time the character picks up the phone, the duplicate sitting on the table turns invisible and the one in his hand becomes visible. Then just reverse the process when he puts the phone back down.
    I'm pretty sure you could edit the parent of the phone in code so the phone is parented to the table up until the character grabs it at which time the parent switches to the characters hand, and back to the table when he puts it back down, but I don't know how that is done.

    Hope this gives you an idea of a solution if you haven't already got it working.