Forum rules - please read before posting.

Switch Lip Sync Texture by Action

Hi Chris,

I have assigned lip sync texture component to a 3D NPC model. It works fine that all lip sync texture turn up accordingly through dialogue.
One of the frame of my lip sync texture is a happy face. And I would like to make the frame turn up by an action but not by speaking a dialogue. I can't find any AC action can achieve this now. Is there any way to turn up a specific lip sync texture frame through action? Any suggestion? Thanks a lot.

Comments

  • Would this be when the character is not speaking - so that you'd be looking to just change the first texture in the Inspector?

    That'd be possible through a script attached to the same object:

    using UnityEngine;
    
    public class ChangeLipSyncTexture : MonoBehaviour
    {
    
        public Texture2D textureA, textureB;
    
        public void SetTextureA ()
        {
            GetComponent <AC.LipSyncTexture>().textures[0] = textureA;
        }
    
        public void SetTextureB ()
        {
            GetComponent <AC.LipSyncTexture>().textures[0] = textureA;
        }
    
    }
    

    This provides two functions to set the first texture to either Texture A or Texture B. You can then use either the Object: Send message or Object: Call event Actions to trigger the functions and update the texture.

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.