Hi Brian, thanks for the recent update.
Now this may be adressed in the next part, or in Nathan’s course, if that is the case please let me know
Getting errors for pathing on switch state exit after hitting an enemy
Since the state is switched with the agent disabled
SetDestination
"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:SetDestination (UnityEngine.Vector3)
RPG.States.Enemies.EnemyPatrollingState:Enter () (at Assets/Scripts/States/Enemies/EnemyPatrollingState.cs:63)
RPG.States.StateMachine:SwitchState (RPG.States.State) (at Assets/Scripts/States/StateMachine.cs:13)
EnemyIdleState:Enter () (at Assets/Scripts/States/Enemies/EnemyIdleState.cs:18)
RPG.States.StateMachine:SwitchState (RPG.States.State) (at Assets/Scripts/States/StateMachine.cs:13)
RPG.States.Enemies.EnemyAttackingState:Tick (single) (at Assets/Scripts/States/Enemies/EnemyAttackingState.cs:56)
RPG.States.StateMachine:Update () (at Assets/Scripts/States/StateMachine.cs:18)
ResetPath
"ResetPath" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
RPG.States.Enemies.EnemyPatrollingState:Exit () (at Assets/Scripts/States/Enemies/EnemyPatrollingState.cs:108)
RPG.States.StateMachine:SwitchState (RPG.States.State) (at Assets/Scripts/States/StateMachine.cs:11)
RPG.States.Enemies.EnemyPatrollingState:Tick (single) (at Assets/Scripts/States/Enemies/EnemyPatrollingState.cs:75)
RPG.States.StateMachine:Update () (at Assets/Scripts/States/StateMachine.cs:18)
SetDestination - Chasing State
"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:set_destination (UnityEngine.Vector3)
RPG.States.Enemies.EnemyChasingState:MoveToPlayer (single) (at Assets/Scripts/States/Enemies/EnemyChasingState.cs:84)
RPG.States.Enemies.EnemyChasingState:Tick (single) (at Assets/Scripts/States/Enemies/EnemyChasingState.cs:41)
RPG.States.StateMachine:Update () (at Assets/Scripts/States/StateMachine.cs:18)
checked the sample version (doesn’t trigger an error), couldn’t pinpoint the source
made the updates in Mover.cs to my project (might be worth mentioning these in the tutorial post)
If the enemy doesn’t have a patrol path, only the set destination call error from the chasing state is called
What am I missing here?
Why doesn’t the sample version trigger these errors? (I actually think it should, no?)