Forum rules - please read before posting.

Could not set correct GameState!

Hi i am getting this error:

Could not set correct GameState!

-----------------------------
UnityEngine.Debug:LogWarning(Object, Object)
AC.ACDebug:LogWarning(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:26)
AC.ActionListManager:SetCorrectGameStateEnd() (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:491)
AC.ActionListManager:EndList(ActiveList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:407)
AC.ActionListManager:EndList(ActionList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:376)
AC.ActionList:Kill() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:586)
AC.<EndCutscene>c__Iterator3:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:515)


After that: 

NullReferenceException: Object reference not set to an instance of an object
AC.ActionListManager.PurgeLists () (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:508)
AC.ActionListManager.SetCorrectGameStateEnd () (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:494)
AC.ActionListManager.EndList (AC.ActiveList activeList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:407)
AC.ActionListManager.EndList (AC.ActionList actionList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:376)
AC.ActionList.Kill () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:586)
AC.ActionList+<EndCutscene>c__Iterator3.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:515)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)


What could it be?

Comments

  • In what versions of AC and Unity, and at what point does this occur?

    It looks like an ActionList is being run when there is no PersistentEngine prefab in the scene.  Is there a GameEngine prefab in the scene outside of runtime, and does a PersistentEngine spawn when you run it?  If so, check that the PersistentEngine has both the StateHandler and ActionListAssetManager components on it - though the Console should warn you on startup if it doesn't.
  • edited September 2016
    I´m running latest version of Unity & AC. The ActionList is switching to a Non-AC scene at the end of the ActionList, the i delete the Non-AC Prefabs like PersistentEngine & PlayerPrefab per Code. But at the end of the ActionList it should be ok or not ? I delete them cause of cleaness and perfomance.  

    EDIT: Tryed it without deleting the PersistentEngine. No Null Error this time but if i switch back to the AC Scene i can do nothing. The Player can`t move or anything. Also all Hotspots are disabled. Tryed with a Action to enable them on scene start but´s not working. Is this a problem with the stateHandler? 
  • Don't delete the PersistentEngine - it stores your gameplay data and goes to sleep automatically when you enter a non-AC scene.

    It should, however, wake up again when you re-enter the AC scene.  Would you be able to provide a detailed step-by-step account of exactly what you're doing (i.e. the Action to change scene, the code to go back to the AC scene, and any messages that appear in the Console)?
  • Nevermind. I did a TurnONAC in code. This fixed my issues. It would be nice, if you can implement a clean solution in AC for changing a scene to Non-AC without the Player Prefab. A simple Toggle would do the thing maybe. And maybe a solution to switch back... any example script or so. Greetz ;) 
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.