Week 7: Animation’s Parallel [Universe]
May 1, 2025
Hello everyone, and welcome back to Constructing [daybreak]! Today’s agenda will consist of a quick—also the first and the last—update on how combining Nicole’s visual side of the project with the parts I’ve created is going, as well as some (almost) final visual updates on my end.
01. Flowers on the Tree
If you have been following Nicole’s blog, you probably know by now that upon resolving the Unity issues, Nicole has been pumping out motion capture animation clips to run on our characters. Enter the murky area of animation where our projects overlap: how are we going to run the animations when the story requires it?
Luckily, I only have to resolve half of this problem; at this point in time (assuming this blog post comes out after Nicole’s post), Nicole has already figured out how to play animations using the animator controller. In my code, I can then reference the same animator controller and instruct Unity to play animations according to the narrative. Using the preexisting binary tree structure and simply adding additional information about which animation clip to play as part of each dialogue node in my binary tree, we can achieve this result:

Hopefully, that GIF works on your end. While the animations have much room for improvement, I will be passing back the role of animation production back to Nicole; my job in coding a script to play animations is done.
02. [Day/Night] Cycle : “I fixed it”/”I broke it”
Now, back to our regularly scheduled program of UI and Unity issues! Upon adding a new screen (as shown in the image below) to display all the scenes that the player has played through and allow them to turn back time to a previous scene instead of only turning back time within a scene, the entire game once again broke down.
Fast forward to the end of my detective journey for why the entire game bugged out, and the issue once again lies in a clash between Unity and my spawned game objects, the prefabs. Simply put, Unity clears all of my spawned prefabs every time a new scene starts; here, one can clearly notice the problem, as the functionality I am trying to add requires me to “travel” across scenes, quitting an old scene and starting a new one.
What complicates this issue further is that all of the narrative is meant to be played through in one Unity scene, and “progressing” to a different narrative scene is merely reloading the current Unity scene with the next binary tree containing the dialogue of the narrative. This prevents me from using the traditional DontDestroyOnLoad() function on my prefabs—I am not progressing to a new Unity scene, meaning Unity cannot retain game objects from a previous Unity scene, as the previous Unity scene (currently the title screen) does not actually contain my prefabs.
So, I must find a workaround. Enter more recursion; by adding a boolean (true-false) marker indicating whether I have visited a node on my binary tree or not, I can respawn all of my prefabs every time I select a scene to turn back to, as well as when Unity actually reloads the scene and begins playing the narrative again. For a better representation, see this demo below (also a GIF that I really hope plays):

That’s all for this week! As this project progresses into its final stages, the focus of the remaining blog posts will be on implementing AI. As a result, this may be the last time you get to see Kai and Vixen in all their 3D glory in my blog.
Say goodbye, and I’ll see you next week!
Leave a Reply
You must be logged in to post a comment.