Unity 2020.311f1
Ac 1.75.0
I have a Unity UI menu that's giving this error and preventing the scene from launching:
NullReferenceException: Object reference not set to an instance of an object
AC.MenuInteraction.CopyInteraction (AC.MenuInteraction _element, System.Boolean ignoreUnityUI) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInteraction.cs:121)
AC.MenuInteraction.DuplicateSelf (System.Boolean fromEditor, System.Boolean ignoreUnityUI) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInteraction.cs:105)
AC.Menu.Copy (AC.Menu _menu, System.Boolean fromEditor, System.Boolean forceUIFields) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/Menu.cs:368)
AC.PlayerMenus.RebuildMenus (AC.MenuManager menuManager) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:155)
AC.PlayerMenus.OnInitPersistentEngine () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:87)
AC.StateHandler.Initialise (System.Boolean rebuildMenus) (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:121)
AC.KickStarter.SetPersistentEngine () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:182)
AC.KickStarter.Initialise () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1138)
AC.MultiSceneChecker.Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:43)
Everything was working when I had only 2 of the buttons linked. The issue started when I went and linked all the 12 elements.
Any ideas what it could be?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
12 elements as in 12 separate Interaction elements?
As a test, open up AC's MenuInteraction.cs script, and look for the following around line 121:
Replace it with:
Does that resolve it?
Thanks, that worked!