Forum rules - please read before posting.

Blinking 2D Character Portraits?

What's a way in which you can set up 2D character portraits to blink and speak? I'm using speech text lip syncing right now. Could the character portrait either go to an idle animation after speaking or, if it's possible to set up layers, have blinking occur at the same time as the lip syncing animation on a different layer?

Another thread briefly mentions this and using Sprites Unity Complex and I think it's alluded to in the manual because of the expression IDs? If I'm reading it right. But what do you do from there? Add animations to your animation controller with the expression ID?

Thank you.

Comments

  • A character's portrait, as shown in a Subtitles Menu when speaking, is separate from the character's animation engine.  Sprites Unity Complex allows for expressions to be mapped to an integer parameter, but this affects the base character sprite - not their portrait graphic.

    Portrait graphics are typically only shown when a character is speaking.  You can have them animate mouth-shapes as they speak, or change their expression (each with its own set of mouth-shape frames), but it doesn't allow for blinking outside of having the character close their eyes in one of their mouth-shape frames.

    If you display your portraits in a Unity UI-based Menu, however, you can extend this Menu through custom scripting and custom events to add a separate "blinking" graphic on top of the main portrait.  The event that the tutorial uses, OnStartSpeech, can be used to initialise such a graphic according to the speaking character.

    First, attach a short script that stores a character's "blinking" texture can be assigned to each character:


    Then, attach a separate script on your Subtitles UI canvas that updates an Image component with the currently-speaking character's blinking texture:


    Since you're dealing with Unity UI, you can then attach an Animator to the Image component to have it turn on/off at pre-defined intervals to give the illusion of the character blinking.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.