Forum rules - please read before posting.

Lip syncing for specific game objects, otherwise turn it off?

I have it set to Lip Syncing for Portrait and Game Object because there are certain cutscenes where I switch to larger 2D or 3D sprites, however, this causes Sprites Unity 2D characters to produce jerky motion because instead of playing a simple Talk animation like I want them to, the frames will shuffle around as if they're phonemes.

Is there a simple way to disable Lip Syncing when it's not in use, or to disable it for certain characters?

Comments

  • Any Manager field can be changed at runtime through script - just right-click the field's label and choose "Copy script variable". In the case of the Perform lipsync on field, it's:

    AC.KickStarter.speechManager.lipSyncOutput
    

    This can be modified in a custom Action so that you can change it when such a cutscene begins and ends:

    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionSetLipSyncMode : Action
        {
    
            public LipSyncOutput lipSyncOutput;
    
            public ActionSetLipSyncMode ()
            {
                this.isDisplayed = true;
                category = ActionCategory.Dialogue;
                title = "Set lipsync mode";
            }
    
            override public float Run ()
            {
                KickStarter.speechManager.lipSyncOutput = lipSyncOutput;
                return 0f;
            }
    
            #if UNITY_EDITOR
    
            override public void ShowGUI ()
            {
                lipSyncOutput = (LipSyncOutput) EditorGUILayout.EnumPopup ("New lipsync output:", lipSyncOutput);
    
                AfterRunningOption ();
            }
    
            public override string SetLabel ()
            {
                return lipSyncOutput.ToString ();
            }
    
            #endif
    
        }
    
    }
    
  • Any Manager field can be changed at runtime through script - just right-click the field's label and choose "Copy script variable". In the case of the Perform lipsync on field, it's:

    AC.KickStarter.speechManager.lipSyncOutput
    

    This can be modified in a custom Action so that you can change it when such a cutscene begins and ends:

    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionSetLipSyncMode : Action
        {
    
            public LipSyncOutput lipSyncOutput;
    
            public ActionSetLipSyncMode ()
            {
                this.isDisplayed = true;
                category = ActionCategory.Dialogue;
                title = "Set lipsync mode";
            }
    
            override public float Run ()
            {
                KickStarter.speechManager.lipSyncOutput = lipSyncOutput;
                return 0f;
            }
    
            #if UNITY_EDITOR
    
            override public void ShowGUI ()
            {
                lipSyncOutput = (LipSyncOutput) EditorGUILayout.EnumPopup ("New lipsync output:", lipSyncOutput);
    
                AfterRunningOption ();
            }
    
            public override string SetLabel ()
            {
                return lipSyncOutput.ToString ();
            }
    
            #endif
    
        }
    
    }
    
  • Thank you! I looked at the custom actions but quickly got stumped.

    Unfortunately, when I put this script in the Actions folder I get this error:

    The script '...\TEoA\Assets\AdventureCreator\Scripts\Actions\ActionLipSync.cs' must derive from AC's Action class in order to be available as an Action.

    -> AC debug logger
    UnityEngine.Debug:LogError(Object, Object)
    AC.ACDebug:LogError(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:34)
    AC.AdventureCreator:RefreshActions() (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:5

  • Restarting Unity should solve it, though it's best practice to place any custom Actions in a new folder outside of your AdventureCreator directory, and then point to it via the Actions Manager.

  • I placed the action script in another folder and restarted Unity (several times) and still get the error.

  • The filename is wrong - it needs to match the class name.

    Rename it to ActionSetLipSyncMode.cs and it should work.

  • Ohh, okay, thank you!

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.