Forum rules - please read before posting.

Skiping Subtitles While Scrolling

Hello.
Sry for my english.

Can I make a specific subtitle menu not respond to clicks. I need the subtitle-text to be impossible to skip while scrolling (or display the full text) when clicked in cut scenes. But I need it without blocking inputs. At the moment, I see an implementation only using Unity UI with blocking raycasts panel. Is it possible to do this using the AC Game Editor settings?

Thanks.

Comments

  • You can use script to alter your Manager field values at runtime - just right-click a field's label to get an API reference to it that can be copied into a custom script.

    In the case of the Subtitles can be skipped? option, for example, that'd be:

    AC.KickStarter.speechManager.allowSpeechSkipping
    

    What would the conditions be for when a cutscene should not allow speech-skipping? By "specific subtitle menu", do you mean you have multiple Subtitle menus, and you're unlocking one in particular during such sequences?

    If so, you can hook into the OnMenuTurnOn / OnMenuTurnOff event hooks to alter the above field's value when this Menu is turned on and off:

    using UnityEngine;
    using AC;
    
    public class DisableSpeechSkipping : MonoBehaviour
    {
    
        public string menuName = "Subtitles";
    
        private void OnEnable ()
        {
            EventManager.OnMenuTurnOn += OnMenuTurnOn;
            EventManager.OnMenuTurnOff += OnMenuTurnOff;
        }
    
        private void OnDisable ()
        {
            EventManager.OnMenuTurnOn -= OnMenuTurnOn;
            EventManager.OnMenuTurnOff -= OnMenuTurnOff;
            AC.KickStarter.speechManager.allowSpeechSkipping = false;
        }
    
        private void OnMenuTurnOn (AC.Menu menu, bool isInstant)
        {
            if (menu.title == menuName)
            {
                AC.KickStarter.speechManager.allowSpeechSkipping = false;
            }
        }
    
        private void OnMenuTurnOff (AC.Menu menu, bool isInstant)
        {
            if (menu.title == menuName)
            {
                AC.KickStarter.speechManager.allowSpeechSkipping = true;
            }
        }
    
    }
    
  • Thank you very much. Your script helped a lot.

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.