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:
- 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)
- 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)
- 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