Forum rules - please read before posting.

"Skip with mouse clicks" question

I have both "skip with mouse clicks" and "subtitles during gameplay can also be skipped?" checked, and they work as intended. However, I also have a "pause" interface button, and I want the player to be able to click it during speech (thus pausing the game instead of skipping it). A click anywhere else should still skip the subtitle. Is there a way to make the menu click take precedence?

Comments

  • If it's an AC menu, no - speech-related input is handled before menus in the AC update loop.

    If it's a Unity UI menu: I'm not sure when UI Buttons receive input relative to other components, but AC's update loop comes from the StateHandler script. It might be worth trying to increase that script's Script Execution Order to see if that causes UI Buttons to be updated before it.

    The alternative approach, which should work with both menu styles, would be to uncheck Skip with mouse clicks?, and instead rely on the SkipSpeech input, map it to a mouse click, and then override the input check through script:

    using UnityEngine;
    using AC;
    
    public class SkipSpeechExample : MonoBehaviour
    {
    
        void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate = CustomGetButtonDown;
        }
    
        private bool CustomGetButtonDown (string buttonName)
        {
            if (buttonName == "SkipSpeech")
            {
                Vector2 invertedMouse = KickStarter.playerInput.GetInvertedMouse ();
                if (PlayerMenus.GetMenuWithName ("MyMenu").IsPointInside (invertedMouse))
                {
                    // Mouse over "MyMenu", ignore input
                    return false;
                }
                return Input.GetButtonDown (buttonName);
            }
    
            try
            {
                return Input.GetButtonDown (buttonName);
            }
            catch {}
    
            return false;
        }
    
    }
    
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.