Ok I hope this isn’t considered necroing a thread but my console is getting spammed with warnings and errors after trying this. I am not trying to do anything with Patrol Paths – just doing the basics. I also applied Brian’s fix to OnValidate but it just moved the errors and warnings around but didn’t actually get rid of them.
It seems to work fine but the spamming of errors and warnings is too much. It makes it hard to use my logs.
here’s what I’m seeing
- I’m getting multiple instances of this error upon entering play mode. 2 separate batches of 5-6 instances per RespawnManager
Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks, rendering callbacks or OnValidate. You must use Destroy instead.
UnityEngine.Object:DestroyImmediate (UnityEngine.Object)
RPG.Respawnables.RespawnManager:OnValidate () (at Assets/Scripts/Respawnables/RespawnManager.cs:90)
- Also getting multiple variations of this warning upon entering play mode. 2 sets of ~13 warnings
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate (Canvas: OnCanvasHierarchyChanged)
UnityEngine.Object:Instantiate<RPG.Control.AIController> (RPG.Control.AIController,UnityEngine.Transform)
RPG.Respawnables.RespawnManager:OnValidate () (at Assets/Scripts/Respawnables/RespawnManager.cs:92)
- A few instances of this warning after entering playmode
Failed to create agent because there is no valid NavMesh
UnityEngine.Object:Instantiate<RPG.Control.AIController> (RPG.Control.AIController,UnityEngine.Transform)
RPG.Respawnables.RespawnManager:OnValidate () (at Assets/Scripts/Respawnables/RespawnManager.cs:92)
- A few instances of this one after exiting playmode
Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks, rendering callbacks or OnValidate. You must use Destroy instead.
UnityEngine.Object:DestroyImmediate (UnityEngine.Object)
RPG.Respawnables.RespawnManager:OnValidate () (at Assets/Scripts/Respawnables/RespawnManager.cs:90)
- A few instances of this one again
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate (Canvas: OnCanvasHierarchyChanged)
UnityEngine.Object:Instantiate<RPG.Control.AIController> (RPG.Control.AIController,UnityEngine.Transform)
RPG.Respawnables.RespawnManager:OnValidate () (at Assets/Scripts/Respawnables/RespawnManager.cs:92)
- and then a few instances of this other one triggered on Awake
Destroy may not be called from edit mode! Use DestroyImmediate instead.
Destroying an object in edit mode destroys it permanently.
UnityEngine.Object:Destroy (UnityEngine.Object)
RPG.Respawnables.RespawnManager:Respawn () (at Assets/Scripts/Respawnables/RespawnManager.cs:63)
RPG.Respawnables.RespawnManager:Awake () (at Assets/Scripts/Respawnables/RespawnManager.cs:28)