Forum rules - please read before posting.

Mouse Disappears during Action List Operation on Build

edited September 2020 in Technical Q&A

Hi there,

I have an issue where the mouse disappears during an Sequence I'm controlling through an Action List. While the mouse is fully visible when I test it in the Editor, it completely disappears on builds.

In my scene I have a series of actions and conversations that occur however, I also have a minigame that I've programmed to appear in the middle of the Action List events. To control it, a Global AC bool variable that turns it off and on. Normally this works and the mouse is visible. However, in one instance, I need the player to do the minigame and then hit a confirm button, which is set to turn the variable off and continue the Action List events.

As such I configured my Action List with a Variable: Set action set the AC Global Variable to true when it needs to to trigger the minigame, connected to a Variable: Check action to check if the variable is false (pressing the submit button tells another script to set that variable to false). If the Variable Check sees the condition is met (variable = false), it will continue the Action List, otherwise, it moves into an Engine: Wait that waits for 0.5 seconds and loops back into the Variable: Check to keep checking. This continues until the condition is met and it continues the Action List.

Normally in the Unity editor, this works. However, when I export a build, the mouse disappears completely. Things are still selectable and the minigame can be completed, but it's difficult since you can't see your cursor. If I use Action Lists to normally enable the variable without any follow up, it works fine and the cursor is visible in the minigame. However, it seems my variable check process is causing an issue here.

On a minor note, I've also noticed that build versions also seem to hid the cursor in between camera switches as well, but it's not as big an issue as the Minigame issue.

I've gone through AC's settings and even set it to Always Display Cursor in the Cursor menu, but nothing seems to work.

How can I fix this?

Comments

  • What's the "AC Game State" set to during this time? It's displayed in the "AC Status" box which can be enabled at the bottom of the Settings Manager.

    Using AC alone, the cursor should only hide (or switch to the "cutscene" cursor) when either locked or in Cutscene mode. In the Editor though, there is an option to always display the system cursor regardless of the state of the AC cursor.

    As you're using custom/third-party scripts, it may be that something outside of AC is contributing. What exactly occurs when the minigame is run?

    But looping an ActionList like that typically isn't best practice. You should instead run a separate ActionList at the same time that you set the Variable to False.

    How/when are you setting the Variable back to False? ActionLists can also be run via script by calling their Interact() method.

  • When this issue ocurrs, AC status is Current Game State: Cutscene and Gameplay is Blocked. When the Dialogue System is active, the Game State changes to DialogueOptions. Whenever the Action List system is switching Camera though, it's Cutscene as well. It seems that a Cutscene state makes the cursor disappear. What do you mean by "Cutscene" cursor? How to I access the settings for that.

    The minigame itself hardly has an effect on AC though. It is set to trigger whenever one of AC's Global Variables is set to true and disappear when set to false. The Action List tells it to go true and then a confirm button ending the minigame when finished just switches the AC Variable to false. That's all. Because the minigame is a system that I'll be using several times, I'm not sure how reuseable it will be to make an Interact() method specifically to control specific Action Lists.

    Could you describe how I would make an Action List that constantly looks for the status of the variable? Looping like that was the only way I could think of that worked since the Variable: Check only checks once and isn't constant.

  • edited September 2020

    If you're in Cutscene mode, the cursor will disappear unless you assign a Cutscene cursor. You can assign a Cutscene cursor graphic in the Cursor Manager.

    the minigame is a system that I'll be using several times, I'm not sure how reuseable it will be to make an Interact() method specifically to control specific Action Lists.

    I mean, if things were working for you before - then by all means stick with your existing method.

    There's a few ways you can go about an alternative though. Through script, you can hook into the OnVariableChange event to detect when the variable has been set back to false, and then run an ActionList:

    using UnityEngine;
    using AC;
    
    public class DetectMinigameOver : MonoBehaviour
    {
    
        public ActionList actionListOnFalse;
    
        private void OnEnable () { EventManager.OnVariableChange += OnVariableChange; }
        private void OnDisable () { EventManager.OnVariableChange -= OnVariableChange; }
    
        private void OnVariableChange (GVar variable)
        {
            if (variable.label == "Minigame" && !variable.BooleanValue)
            {
                actionListOnFalse.Interact ();
            }
        }
    
    }
    

    It may be that you can do without the variable entirely, though, by setting up - in advance - what ActionList to run once the minigame is over.

    If you run an ActionList asset when ending the minigame, it'll always start with the same Actions regardless of when/how it was begun.

    What you can then do is - inside that asset - have an ActionList: Run Action that then triggers a different ActionList / Cutscene based on the circumstances of the minigame. That is, if you start Minigame A, it'll then run Cutscene A upon finishing; starting Minigame will run Cutscene B; etc.

    You'll then need to set which ActionList/Cutscene dynamically through parameters. Create a new GameObject parameter (if a Cutscene), or Unity Object (if an Actionlist asset), and use it to override the ActionList: Run Action's "ActionList to run" field.

    Then, before the Minigame is begun, use an ActionList: Set parameter Action to set the value of this parameter - so that when the ActionList asset is later run (by ending the minigame), it'll already have a record of which ActionList to then run.

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.