Forum rules - please read before posting.

Prefab and Actionlist

Good day, I have a Actionlist on a trigger object that needs to dissapear when the player is colliding with it. The object is a prefab. But as soon as I add the prefab to the scene and want to change some parameters the actionlist is clear and all the code is gone. Then as soon as I add a node I get the following error from Unity. Undo objects may not be null.
UnityEditor.Undo:RecordObjects (UnityEngine.Object[],string)
AC.ActionListEditor:ModifyAction (AC.ActionList,AC.Action,string) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditor.cs:687)
AC.ActionListEditorWindow:PerformEmptyCallBack (string) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:2292)
AC.ActionListEditorWindow:TopToolbarGUI (bool) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1065)
AC.ActionListEditorWindow:OnGUI () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:239)
UnityEngine.GUIUtility:ProcessEvent (int,intptr)

I am using Unity 2019 LTE and AC 1.75.8

PS: In all of the other scene that same prefab is working perfectly.


  • I can't recreate the specific error message, but scene-based Actions cannot exist in prefabs. If you want to share Actions between scenes, use an ActionList asset file instead.

    You can still prefab the Trigger, but set its Actions source field to Asset File, and then assign the separate ActionList asset that handles the Actions that run when its triggered.

    If you want these Actions to be dynamic, and affect the object that triggered it, you can use parameters and attach the Set Trigger Parameters component to the prefab.

    A video covering an example of this workflow can be found here.

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.