Forum rules - please read before posting.

How can I run a custom actionlist in my custom action?

I've written a custom action, and I want to run a custom ActionList inside of it.What I want is shown below.

ActionList actionList = new ActionList();
actionList.actions.Add(ActionSpeech.CreateNew(KickStarter.player, contentSplit[j]));
actionList.actions.Add(ActionScene.CreateNew_Switch(contentSplit[j], true, true));
actionList.Interact();

But it gets error when running,because of the actionlist isn't asigned any gameobject.
Maybe you have a better idea to achieve it?

Comments

  • The ActionList class derives from MonoBehaviour - you must use AddComponent to create a new instance of it, i.e.:

    ActionList actionList = gameObject.AddComponent <ActionList> ();
    

    See the included ScriptedActionListExample script's CreateActionList function for an example of how this can be used.

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.