Forum rules - please read before posting.

Changing cutscene and pause cursor behavior

Hi,
I followed the title menu creation tutorial and managed to have the "pause" menu appear when pressing escape.
Sadly, no cursor was visible, so I added the cursor on cutscenes, but I'd like to know if there is a way to hide the cursor during cutscenes but to make it appear only when pressing escape (displaying the pause menu/load/save/options).
Thank you.

Comments

  • edited September 2021

    The fact that the menu is on shouldn't alone cause AC to be in "cutscene" mode. If the cutscene cursor is active at this time, it suggests an ActionList is running at the time that's blocking regular gameplay.

    If you enable the AC Status box at the bottom of the Settings Manager, it'll display the game's current state in the top-left corner of the Game window at runtime. What does it display when the issue occurs?

    If the game is in "Cutscene" mode, this box should list any ActionLists that are currently running that will cause this to be the case. See if any lists are being displayed, and if so, view them in the ActionList Editor window. Any currently-running Actions should be highlighted to aid debugging. Check also the properties of the ActionList, which are shown at the top of its Inspector.

    Share screenshots and I'll try to spot what's up.

  • Thanks for your reply, I apologize my question was not precise enough.
    The states are correct (cutscene or pause) and the only Action list running is the "on start", but that is not the problem I'm facing.
    My issue lies within the "cutscene cursor behaviour",
    I'd like to know if it there is a way to hide it during cutscenes and show it (during cutscenes) only when the pause menu is displayed.

  • edited September 2021

    No problem, thanks for clarifying.

    What you're going to want to do is assign your cutscene cursor texture into the Cursor Manager field dynamically through script.

    To modify any Manager property through script, right-click its label (or texture field, in the case of textures) to get an API reference to it. A reference for the cutscene cursor texture can be gotten in this way:

    AC.KickStarter.cursorManager.waitIcon.texture
    

    To assign this when your Pause menu turns on, and clear it when your Pause menu turns off, you can hook into the OnMenuTurnOn / OnMenuTurnOff custom events. Events are a way of hooking up custom code into common tasks that AC performs - in this case, turning a menu on and off.

    This script should do it: place in a C# file named DynamicCutsceneCursor.cs, and attach to a GameObject in your scene:

    using UnityEngine;
    using AC;
    
    public class DynamicCutsceneCursor : MonoBehaviour
    {
    
        [SerializeField] private Texture2D cutsceneCursorTexture;
    
        private void OnEnable ()
        {
            SetCursorTexture (null);
            EventManager.OnMenuTurnOn += OnMenuTurnOn;
            EventManager.OnMenuTurnOff += OnMenuTurnOff;
        }
    
        private void OnDisable ()
        {
            EventManager.OnMenuTurnOn -= OnMenuTurnOn;
            EventManager.OnMenuTurnOff -= OnMenuTurnOff;
        }
    
        private void OnMenuTurnOn (Menu menu, bool isInstant)
        {
            SetCursorTexture (cutsceneCursorTexture);
        }
    
        private void OnMenuTurnOff (Menu menu, bool isInstant)
        {
            if (menu.title == "Pause")
            {
                SetCursorTexture (null);
            }
        }
    
        private void SetCursorTexture (Texture2D texture)
        {
            KickStarter.cursorManager.waitIcon.texture = texture;
        }
    
    }
    
  • Thank you, you're a godsend! Not just for helping out but also for making this jewel of an engine.

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.