Hello, I am switching scenes using the Scene: Switch action. None of the menus turn on. For example the AC Pause Menu won't turn on until after I click a different hotspot with an interaction on it. I am using the Menu: Change State: Turn On Menu action to turn on the menus. Both action lists are set to Run In Background. Thank you.
I posted a new comment with links to screenshots but a message said the need to be approved. They didn't really show much. The Action List are only action lists I created and they only had one action in each, the aforementioned Scene: Switch action and Menu: Change State: Turn On Menu action.
Still occurs in builds.
I get a NullReferenceException if I switch the Menu Manager for some variable that I created in some custom code.
Please try to give as much detail as you can, as I need it in order to properly help. Again, how are you and when are you running your ActionLists?
If you are running custom code that affects your menus, is it possible that it's interfering AC's enabling of them? Please post the error message in full, if it is coming from AC's scripts.
Regardless, we need to know if this is a result of your own Menu Manager, or if it occurs with the Demo game's. If switching asset causes an error due to custom code, you'll have to temporarily remove that code so that we can find out.
Switching the menu manager to the Default Menu Manager causes errors because of the reliance on custom menus I made. Maybe you can take a look at the project? I will IM you a link to the file. You are able to produce the error below by switching scenes and trying to open the game menu (lower right icon). You can switch between the kitchen and hallway scenes by using the hotspot located on the bottom middle of the scene. As you can see, after switching scenes the menu stops working. You can also test with the journal button (directly to the left of the menu button in the lower right of the screen).
You can see how both menus work before switching scenes but not after.
I hope this helps.
The error I am seeing when I click the game menu (lower right icon):
I get no such issues occuring when switching to the Hallway from the Kitchen.
Please follow my previous instructions - we must rule out this being related to your own custom scripts. Even if it's in a duplicate test project, assign the Demo / Default Menu Manager asset file. Any reliance on custom script should also be removed to prevent related errors - we first need to know if this is down to these scripts, or occur even when AC is working alone.
The error messages are nothing to do with AC. They appear (for me at least) because no sprites were being set in your custom events attached to your Pause Menu's buttons. Assigning sprites to the three events on all six buttons removed the error message. Also note that AC's Event Manager script should not be attached to any GameObjects manually.
By the way, I was never under the assumption that there was something wrong with AC's code. AC has been amazingly helpful to get my game where it is today. I just figured I did something wrong that you possibly had already encountered and you were right, it was probably those event managers that were in my scenes for some reason.
Comments
Please share more detail, there's not enough here to answer properly. Also, do you get any relevant messages in the console?
I am switching scenes using the Scene: Switch action. None of the menus turn on. For example the AC Pause Menu won't turn on until after I click a different hotspot with an interaction on it. I am using the Menu: Change State: Turn On Menu action to turn on the menus. Both action lists are set to Run In Background. Thank you.
I posted a new comment with links to screenshots but a message said the need to be approved. They didn't really show much. The Action List are only action lists I created and they only had one action in each, the aforementioned Scene: Switch action and Menu: Change State: Turn On Menu action.
Still occurs in builds.
I get a NullReferenceException if I switch the Menu Manager for some variable that I created in some custom code.
If you are running custom code that affects your menus, is it possible that it's interfering AC's enabling of them? Please post the error message in full, if it is coming from AC's scripts.
Regardless, we need to know if this is a result of your own Menu Manager, or if it occurs with the Demo game's. If switching asset causes an error due to custom code, you'll have to temporarily remove that code so that we can find out.
Hi Chris,
Switching the menu manager to the Default Menu Manager causes errors because of the reliance on custom menus I made. Maybe you can take a look at the project? I will IM you a link to the file. You are able to produce the error below by switching scenes and trying to open the game menu (lower right icon). You can switch between the kitchen and hallway scenes by using the hotspot located on the bottom middle of the scene. As you can see, after switching scenes the menu stops working. You can also test with the journal button (directly to the left of the menu button in the lower right of the screen).
You can see how both menus work before switching scenes but not after.
I hope this helps.
The error I am seeing when I click the game menu (lower right icon):
ArgumentException: failed to convert parameters
System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:484)
System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528)
System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77)
UnityEngine.Events.PersistentCall.GetObjectCall (UnityEngine.Object target, System.Reflection.MethodInfo method, UnityEngine.Events.ArgumentCache arguments) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:429)
UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:396)
UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:569)
UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:736)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:772)
UnityEngine.Events.UnityEvent`1[T0].Invoke (.T0 arg0) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_1.cs:53)
UnityEngine.EventSystems.EventTrigger.Execute (EventTriggerType id, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/EventTrigger.cs:67)
UnityEngine.EventSystems.EventTrigger.OnPointerEnter (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/EventTrigger.cs:73)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerEnterHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:22)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerEnterHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update()
Please follow my previous instructions - we must rule out this being related to your own custom scripts. Even if it's in a duplicate test project, assign the Demo / Default Menu Manager asset file. Any reliance on custom script should also be removed to prevent related errors - we first need to know if this is down to these scripts, or occur even when AC is working alone.
The error messages are nothing to do with AC. They appear (for me at least) because no sprites were being set in your custom events attached to your Pause Menu's buttons. Assigning sprites to the three events on all six buttons removed the error message. Also note that AC's Event Manager script should not be attached to any GameObjects manually.