A warning report Failed to create agent

Hi. A problem happened when the player charactor was exiting the portal.

Failed to create agent because it is not close enough to the NavMesh
UnityEngine.StackTraceUtility:ExtractStackTrace ()
RPG.Movement.Move

any solution to advise?


r:RestoreState (object) (at Assets/Scripts/Movement/Mover.cs:94),

Here is the methord code in the Mover class.

        public void RestoreState(object state)
        {
            Dictionary<string, object> data = (Dictionary<string, object>)state;

            navMeshAgent.enabled = false;

            transform.position = ((SerializableVector3)data["position"]).ToVector();

            transform.eulerAngles = ((SerializableVector3)data["rotation"]).ToVector();

            navMeshAgent.Warp(transform.position);

            navMeshAgent.enabled = true;
        }

As long as it’s yellow, feel free to ignore it. It’s one of those things that pops up as a warning, but on the very next frame everything works fine.
If it’s a RED error, that’s when we have to start hunting things down.

Privacy & Terms