Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Shake Hands, Open Door, Ride Vehicle, Multi Character Interactions?

Discussion in 'Animation' started by backwheelbates, Dec 4, 2023.

  1. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Hi,

    I couldn't find much on this, so I'm coming here to ask for advice.

    How do I synchronize and align multiple separate character animations in gameplay?

    For example:
    • Petting a dog
    • Opening a door
    • Riding on and interacting with a vehicle
    If there are any general strategies or examples, that would be super helpful!! Thanks!!
     
  2. It's called inverse kinematics. If you want to do it yourself, check out the Animation Rigging package of Unity (and search for tutorials) or if you want more turn-key solutions, I recommend to check out FinalIK and/or Puppetmaster on the Asset Store, they are great and mature packages and contain everything you ever need to setup your interaction systems.
     
  3. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231
    Hi @Lurking-Ninja , thanks for your reply!

    Yes, Im aware of IK, this is definitely part of it. What about the aspect of having 2 separate animations that need to be aligned spatially and synchronized? If we ignore IK for now, how does this work? How can you have 2 separate characters with 2 separate animators come together to perform together (petting a dog, the person animation with the dogs reaction, or if the door has animation that syncs with a character opening it, etc)?
     
  4. I'm not sure what you're asking, because it is too vague. It depends. You need to manage to move your actors into positions. What are the positions? It depends on the action you're trying to play back. How you move them? It depends how you're handling movement in your application and what kind of animations you have and intend to use. But in general you should have relative positions to each other tailored to the actual interaction you are trying to play back.
    Then you need either animations or code to drive the IK chains to make the interaction properly. They you need to go back to some generic position to release and go back to either player control or some sort of AI control.

    In general, you can choose to have animations and animation events to drive your interactions along with purposefully placed colliders and triggers and have signals to make sure your game logic knows where the animations are.
    Or you can have completely code generated movement and drive the animation from the code part, this needs planning, a bunch of math (vectors, rotations, knowledge about IKs).

    There is no magic, you plan what will happen, make a plan how the interaction will take place and do it. Either make/buy/whatever animations and/or write the code it makes and then handles it.

    The FinalIK/PuppetMaster are almost magic. In reality it's just that the publisher already wrote a big chunk of code you would have to.
     
  5. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    231


    Just found this, this is exactly what I was looking for, more details on mechanically how this works.

    Thanks again @Lurking-Ninja, really appreciate your help.