Forum rules - please read before posting.

Issue with Text Animator Tags Not Working in Speech (AC v1.82.5)

Hi there!

I'm currently using Adventure Creator v1.82.5 and integrating it with Text Animator for Unity to add animated effects to dialogue text. However, while some TextMeshPro features like [color] tags work fine, any of Text Animator's custom tags (shake, wave, fade, etc.) cause the dialogue text to not appear at all.

I’ve set up my UI speech prefab with TextMeshPro and added the TextAnimator component as recommended. I checked if EventManager.OnStartSpeech_Alt fires when these tags are used, but it doesn’t even trigger when a Text Animator tag is present. If I remove the [shake] (or any similar tag), the speech works fine, but as soon as one is included, the text disappears completely.

Any advice or suggestions would be greatly appreciated! Let me know if you need more details.

Thanks in advance! 😊

Comments

  • Are you relying on speech-scrolling?

    Check the GameEngine object's "Dialog" component - this has a list of rich-text tags it allows. You may need to add yours there.

  • edited February 28

    Thanks for your suggestion, Chris.

    I added "shake" to the Rich Text Tags list in the GameEngine-Dialog component, but unfortunately, the issue persists. I also checked Speech Scrolling, tested with both ON and OFF, but there was no change.

    After that, I tried the same setup in AC’s 2D Demo Project:
    -Created a TextMeshPro UI prefab for subtitles.
    -Added the TextAnimator component to the TMP text.
    -Set Subtitles Source to Unity UI Prefab.

    When I ran the project, the text appeared normally. Then, I added "shake" to the Rich Text Tags list in GameEngine-Dialog and modified the speech line to:

    <shake>Oh, hey little bird!</shake>

    However, the text disappeared completely when the line was spoken.

    I also tested Text Animator's Default Tags:

    Added "shake" to Text Animator’s "Default Tags" section. The effect worked, but it applied to all text, which is not the intended behavior. I need to use these effects for only specific words.

    Is there another step needed to ensure AC’s dialogue system correctly passes Text Animator’s custom tags? Let me know if I should check anything else.

    Thanks again for your help.

  • When setting the Menu's Source, did you check Use TMPro components??

    The addition of tags to the Dialog component only applies if text scrolls. Unscrolling, AC will display what's provided as-is - there shouldn't be any additional steps.

    Does the same UI prefab, detached from AC, animate the tags when the placed in a fresh scene and the sample text inserted directly into the TMP text component?

  • Yes, I made sure to check "Use TMPro components" when setting the Menu's Source.
    I also confirmed that scrolling is ON, but the issue remains the same.

    To further test this, I took the same UI prefab and placed it in the scene, completely detached from AC. When I manually inserted text with Text Animator tags into the TMP text component, the animations worked as expected.

    To make debugging easier, I’ve set up a test project using AC’s 2D Demo as a base. I modified the Subtitles menu to use a Unity UI prefab with TextMeshPro and Text Animator properly set up.

    You can download the project here: [https://we.tl/t-2QdeYqwedU]

    Let me know if you need any additional details or if you run into any issues while testing. I really appreciate your time.

  • 404 on the link - and please let it stay that way. Never publicly share links that contains AC's source code - it is a commercial asset.

    I believe the behaviour is down to Text Animator needing the Text component to be updated once, whereas AC will be updating it repeatedly.

    Uncheck Use TMPro components? and attach this script, filling in its Inspector, to have it get updated manually:

    using UnityEngine;
    using AC;
    
    public class TMProSpeech : MonoBehaviour
    {
    
        public TMPro.TextMeshProUGUI tmpProLabel;
        public Canvas canvas;
    
        void OnEnable()
        {
            Menu menu = KickStarter.playerMenus.GetMenuWithCanvas (canvas);
            if (menu != null && menu.speech != null)
            {
                tmpProLabel.text = menu.speech.FullText;
            }
        }
    }
    
  • Hi Chris,

    Sorry about sharing the demo publicly earlier. I didn’t think about that, and I appreciate the reminder.

    About the issue, your script didn’t work in my case because menu.speech was null, so I couldn’t set the text that way. Instead, I took a different approach:

    -I added a Unity Legacy Text component to the prefab.
    -In the Menu settings, I unchecked "Use TMPro components" and created a label object with its type set to "Dialogue Line," linking it to the Legacy Text component.
    -This Legacy Text component is hidden and only used to transfer the text.
    -I modified the script like this:

    using UnityEngine;
    using UnityEngine.UI;
    
    public class TMProSpeech : MonoBehaviour
    {
        [SerializeField] private TMPro.TextMeshProUGUI tmpProLabel;
        [SerializeField] private Text hidedLabel;
    
        void OnEnable()
        {
            if (tmpProLabel == null || hidedLabel == null)
            {
                Debug.LogWarning("TMProSpeech: Missing references! Make sure both tmpProLabel and hidedLabel are assigned.");
                return;
            }
    
            tmpProLabel.text = hidedLabel.text;
        }
    }
    

    -Disabled AC’s built-in scrolling (since it doesn’t work with this approach).

    Since AC’s scrolling couldn't be used in this setup, I added Text Animator's Typewriter - By Character component to handle scrolling instead.

    With this setup, everything is working perfectly.

    Thanks again for your help, and I appreciate your patience. Hopefully, this solution might help others facing a similar issue.

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.