Forum rules - please read before posting.

Stop interaction / action list being completed on Inventory Open

How do I cancel current interaction when opening inventory?

so let’s say I click on exit, and my player starts walking towards exit, but then I decide to open my inventory. I want that action to cancel my going to exit and scene change

How do I do that?

Here are screenshot of my inventory and action list when turn on:

https://www.dropbox.com/sh/9nxs3nwknem7wmd/AAC29l1kk57ztAr-S2vNhe26a?dl=0

Comments

  • If the Character: Move along path Action is used to stop the Player moving, it will also cancel their pending interaction.

  • Thanks. And is there a clean way to choose for a menu to turn off when an action/interaction is happening? And then turn on again after? As if the player uses an object on a hotspot and this interact sets a variable but that action list is then killed on opening inventory, the variable will still be set abs not reverted?
  • A Menu with an "Appear type" of "During Gameplay" will hide automatically during a gameplay-blocking ActionList.

    If you want to turn off a Menu while a particular Interaction is running, you can hook into the OnBeginActionList and OnEndActionList custom events:

    private void OnEnable ()
    {
        EventManager.OnBeginActionList += OnBeginActionList;
        EventManager.OnEndActionList += OnEndActionList;
    }
    
    private void OnDisable ()
    {
        EventManager.OnBeginActionList -= OnBeginActionList;
        EventManager.OnEndActionList -= OnEndActionList;
    }
    
    private void OnBeginActionList (ActionList actionList, ActionListAsset actionListAsset, int startingIndex, bool isSkipping)
    {
        if (actionList.gameObject == gameObject) PlayerMenus.GetMenuWithName ("MyMenu").TurnOff ();
    }
    
    private void OnEndActionList (ActionList actionList, ActionListAsset actionListAsset, bool isSkipping)
    {
        if (actionList.gameObject == gameObject) PlayerMenus.GetMenuWithName ("MyMenu").TurnOn ();
    }
    
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.