public virtual void SetCurrentNode(NavNode newNode) { if (_node != null) { if (_node.AgentBaseHere == this) { _node.ClearAgentHere(this); } //An agent may leave a node that it never occupied. This sometimes happens because of the way moves get chained. //This can happen. It's fine. Items will still catch and release as needed, they listen to those events from Moves, not from the navnodes. } if (newNode == null) { Debug.LogError("AgentBase cannot set node here. Are they at an appropriate location?", gameObject); } else { _node = newNode; newNode.SetAgentHere(this); } }