I have areas of my city where all NPCs can be off until you get near, I have done this using ACs send message to tunr them on and off. Problem is when theyre off I get many errors like this:
Animator is not playing an AnimatorController
UnityEngine.Animator:SetBool(String, Boolean)
AC.AnimEngine_Mecanim:PlayIdle() (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_Mecanim.cs:689)
AC.Char:AnimUpdate() (at Assets/AdventureCreator/Scripts/Character/Char.cs:801)
AC.Char:_Update() (at Assets/AdventureCreator/Scripts/Character/Char.cs:445)
AC.NPC:_Update() (at Assets/AdventureCreator/Scripts/Character/NPC.cs:132)
AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:371)
Is there a way to tell statehandler theyre off and dont need to be updated in anyway until theyre back on ?
Comments
The error message above doesn't line up with the latest release - what version are you using?
The "TurnOff" message you can send to NPCs currently only changes the layer they're on. Have you done anything else to warrant the Animator reporting such a message?
AC.KickStarter.stateHandler.GatherObjects (true);
That updates AC's internal record of what objects are in the scene and require updating. This relies on Unity's FindObjectsOfType method, so disabled objects should be excluded.