|||

Or how on earth to get the Animator in Unity to do what you want it to do.

Like many things in life, once you’ve figured out how it works, it seems simple, but before you get to that point, it’s often beyond frustrating. I’m not entirely sure if my background with the Godot game engine is helping me more or hindering me, as I keep trying to do things in a way that Godot would probably accept, but it is what it is.

In my last post I was sounding rather positive and at this very moment in time I am also positive about where my game project is going. My feelings between those two moments, however, were very different.

After finishing that post I went back to more script writing as I figured that I’d won the battle with my character sprite woes. Almost as soon as I jumped back to testing my character again, did it all start to fall apart with disembodied smiling mouths and other unwanted strangeities.

Disembodied mouth casually floating along…Disembodied mouth casually floating along…

After hours of pouring over documentation and staring glassy eyed at the Animator while the game was running, I finally figured that there was some weirdness being caused by the On Speaking Triggers and the Any State node.

I’d been relying on the Any State node to let me jump around between poses, which works just fine, until I added in the talking mouths. Once I hooked up a pose to an animating mouth, when I tried to change the pose, the mouth would remain in its old pose form even after I’d told it to change. I’m still not entirely sure what is happening, but I think the Triggers coming from the On Speaking function from the Generic Character Implementation (Naninovel) was barreling its way in and taking everything hostage.

So I um-ed and ah-ed and started trying to get used to the idea of not having animated characters at all in my visual novel. If you’ve read my first devlog where I waxed lyrical over PARANORMASIGHT then you might guess that this isn’t something I want to do. In fact, the primary reason I switched from Ren’Py to Naninovel/Unity was to allow for more complex character models with animations and changing parts.

But fortunately, I thought of an idea.

After some forum thread reading, it seems like this solution is quite common in the larger world of Unity and animation, but to me it was a brainwave. Essentially, it involves setting up a second mouth sprite on top of the first that is always talking. These two then share the same animation clips and Animator graph so that they change to the right pose at the right time and the right expression at the right time. Then, the final step that brings it all together, is getting the On Speaking function from Naninovel to control whether the talking mouth sprite is active/visible or not.

Essentially, when the character is speaking, the normal mouth object is deactivated and the talking mouth object is activated, and when they stop speaking, the normal mouth is reactivated while the talking one is deactivated.

So far this works nicely, but I’d like to do more testing and try a few more things before thinking I’ve settled on a solution ready for proper development.

As a side tangent, it seems that my previous issues with trying to animate with the Layered Character implementation (from Naninovel) weren’t exactly not working. It’s just that they only work with animations that involve Deforming the object/sprite and not switching the actual sprite. I’m unsure if this is intended but it basically throws sprite animation all out the window (unless… you tried to do fancy things with Sprite Masks and moving sprite sheets under them to create the illusion of cell animation, but that might just be my Godot background speaking).

Up next 02 - An Adventure From Ren'Py to Naninovel Inkle and UX
Latest posts The Undead 6 The Undead 5 The Undead 4 The Undead 3 The Undead 2 The Undead 1 The Undead (fan translation) 06 - back to Ren'Py & Concept Art 05 - Changing Engines & Changing Projects 04 - Huzzah for Naninovel Urasawa Naoki - The Lies Mangaka Tell Xian Xie Fate Is... Fate Is 3 Fate Is 2 Masahiro Sakurai - Broad Input, Broad Output A Collection of Inkle Wisdom Inkle and UX 03 - Learning to Move 02 - An Adventure From Ren'Py to Naninovel 01 - Engine Woes Head In The Stars