// Update is called once per frame void Update() { navAgentFacingDirection = navAgent.GetFacingDirection(); if (navAgentFacingDirection != cachedDirection) { cachedDirection = navAgentFacingDirection; transform.forward = -cachedDirection; } }