Search Unity

Interaction between two characters

Discussion in 'Animation' started by BDamien54, Feb 22, 2015.

  1. BDamien54

    BDamien54

    Joined:
    Feb 22, 2015
    Posts:
    12
    Hello,

    I'm currently trying to create a game where the player can fight NPCs and I would like to animate the player and the NPC at the same time to create this kind of animation where the player kill the NPC :
    .

    I have no idea how I can do that, I think this shoud be possible using mecanim but I don't know the way to do it. Can anyone help me please ?

    Sorry if I don't speak very well english ; I'm french.

    Thank's in advance!
     
  2. Jself

    Jself

    Joined:
    May 29, 2014
    Posts:
    56
    First thing you need to do is animate 2 characters interacting with each other in the 3d software package. After your scene is animated, then take each character and zero them out at the worlds XYZ in the software package. Then export each character as it's own separate animation.

    So you should have 2 separate animations for 2 characters. 2 FBXs.

    At this point. I have no idea where to go in Unity. :p

    But my experience with other engines would have me setup the enemy AI with a trigger volume attached the AI NPC that would trigger the COOP animations you just created.
     
  3. BDamien54

    BDamien54

    Joined:
    Feb 22, 2015
    Posts:
    12
    Thanks for your answer !! :D
    Yeah I think attaching a trigger to the AI NPC is a good idea ! :)
     
    Jself likes this.
  4. gkillz

    gkillz

    Joined:
    Nov 30, 2012
    Posts:
    4
    Any update on how you managed to obtain the desired effect in Unity??
    and what should be the best approach to handle such situations?
    like if 5-6 characters come together and celebrate by physically hugging etc...

    something like in this video-
    at 0:25 and at 0:50
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Jself's approach is probably the best to do this - I would add - create some null markers in the 3D package so after export - you can position and orient the characters in the exact location so the animation plays seamlessly.

    For the soccer celebration - personally I would animate all these characters in the same scene - and camera cut from the gameplay scene, where the player is in control and scores the goal, to another (watch this) non-interactive scene - where all the characters are animated together.
    This would be accomplished in an external 3D package similar to the solution given above, but for this specific example - all characters and rigs would be exported at the same time together, so all the characters are properly aligned as they should and the interactions would not have to be configured in Unity.
    When in Unity - the scene change (camera cut) would load the celebrating characters and then play the celebration animations all together without having to orient, align and time the characters in Unity.
    If you have multiple celebration animations - depending upon the hotkey pressed - a different scene (and camera cut) would load to play the correct celebration.

    Since this type of character interaction isn't player controlled - I'd go with the simplest solution, trigger a new scene load, the new scene contains all the characters animated together to interact with each other. Once celebration animation is complete, reload the game play scene.

    I have not performed a multi character rig fbx export - so testing this workflow should be done to confirm it works as intended.