Search Unity

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

Question Managing Animations in an Interactive Story

Discussion in 'Animation' started by evanbarba, Nov 1, 2023.

  1. evanbarba

    evanbarba

    Joined:
    Nov 11, 2021
    Posts:
    3
    Hi. I'm working on an interactive VR drama and I'm wondering if there is a best practice around how to handle storyline animations in this context. At its most basic there is a main story arc that will play out between two virtual characters, while the player will observe and can intervene at any time. So, the requirements are:
    1. animations play in a coordinated and preset way between the two characters when no intervention happens, (the story will play like a movie from beginning to end if there is no interaction)
    2. When the player interacts, each character will respond with one of a few animations based on when and how they interact (we can assume that we have ample animations to cover most interactions and responses and logic that will make this work well enough)
    3. When the animations in #2 finish, the story returns to the main storyline
    I've tried a few methods already but all require additional workarounds and I don't want to go too far down a path if there is already a clear way to do this that I'm not aware of. Here's what I've tried so far:

    • used the animators (animator controllers) for the two characters with bools set to trigger each other and other animations, but this becomes spaghetti-like and cumbersome very quickly.
    • Tried to use the StateMachineBehaviour class to trigger other animations when certain ones have completed, but coordinating between the two characters is difficult and accessing a global storyline variable of some sort seems wrong.
    • Using a gameManager type singleton to mange the whole story (by adding and popping animations from a stack), still has problems coordinating actions between characters
    • Using the timeline to coordinate actions between characters and play the whole story, but doesn't seem to have a good way to branch to other animations based on player input and return to the timeline.
    I'm not a Unity pro, so those might not be the best methods to try, but they're all i could think of and none seem ideal. So I'm just wondering if others have ideas or experience that can help me find the best solution.

    Thanks in advance
     
  2. Ahab_

    Ahab_

    Joined:
    May 22, 2019
    Posts:
    58
    Hello.

    I am not certain if I have fully understood you, but I have personally worked on similar projects. My advice would be to use Animancer Pro to gain control over animations through code, instead of creating spaghetti-like controllers. It may present a learning curve initially, but it could solve your issues in the long term.

    Good luck!
     
  3. evanbarba

    evanbarba

    Joined:
    Nov 11, 2021
    Posts:
    3
    Thanks for the reply. I will look into Animancer.