Forum rules - please read before posting.

Stop other actionlists

Hello,

My hotspot interactions don't pause the game on purpose. So I created two actionLists for Interaction menu onstart and onend

here I want to stop other ongoing action lists

an example:

I interact with an object that has 5 dialogues
while listening the first dialogue I interact with another object

now I want the first interaction's actionlist to stop. If it was a single dialogue I could handle with stop all speech action but it doesn't help here

I created a custom action checking AC Status script but getting KickStarter.actionListManager.activeLists returns an empty list although it is on the ac status box.

I tried AC.ActionListManager.KillAll(); but that also kills the current action as well

Can you direct me to a solution?

Thanks

Comments

  • You can kill ActionLists directly from within their class, so you can do a check to exclude a given Action:

    void KillListsExceptAction (Action action)
    {
        ActionList[] allLists = GameObject.FindObjectsOfType <ActionList>();
        foreach (ActionList list in allLists)
        {
            if (!list.actions.Contains (action))
            {
                list.Kill ();
            }
        }
    }
    
  • thanks it works great

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.