Forum rules - please read before posting.

Check if text is currently scrolling

One of the things I've been experimenting with is more button prompts, and my goal in this case is for one to pop up on the subtitles UI when the text has finished scrolling. I've been unable to find anything in the scripting guide, but is there a way to check whether the text is currently scrolling?

Comments

  • You can do this by hooking into the OnCompleteSpeechScroll / OnCompleteSpeechScroll_Alt custom events.

    The latter is new to v1.67.0 and provides direct access to the Speech class:

    using UnityEngine;
    using AC;
    
    public class SpeechScrollListener : MonoBehaviour
    {
    
        private void OnEnable ()
        {
            EventManager.OnCompleteSpeechScroll_Alt += OnCompleteScroll;
        }
    
        private void OnDisable ()
        {
            EventManager.OnCompleteSpeechScroll_Alt -= OnCompleteScroll;
        }
    
        private void OnCompleteScroll (Speech speech)
        {
            Debug.Log ("Stopped scrolling: " + speech.FullText);
        }
    
    }
    
  • 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.