/// <summary>
        /// Updates the target using stored currentPos.
        /// </summary>
        public void UpdateTarget()
        {
            Vector3    position = Vector3.zero;
            Quaternion rotation = Quaternion.identity;
            float      velocity = 1.0f;
            int        waypoint = 0;

            if (pathMagic.presampledPath)
            {
                pathMagic.sampledPositionAndRotationAndVelocityAndWaypointAtPos(currentPos, out position, out rotation, out velocity, out waypoint);
            }
            else
            {
                position = pathMagic.computePositionAtPos(currentPos);
                rotation = pathMagic.computeRotationAtPos(currentPos);
                velocity = pathMagic.computeVelocityAtPos(currentPos);
                waypoint = pathMagic.GetWaypointFromPos(currentPos);
            }

            if (globalFollowPath)
            {
                // Global follow path override
                rotation = pathMagic.GetFaceForwardForPos(currentPos);
            }
            else if (globalLookAt != null)
            {
                // Global look at override
                rotation = Quaternion.LookRotation(pathMagic.transform.InverseTransformPoint(globalLookAt.position) - position);
            }

            _lastVelocity = velocity;

            UpdateTarget(position, rotation);

            // Fire waypointChanged if is the case
            if (waypoint != _lastPassedWayponint)
            {
                if (waypointChanged != null)
                {
                    waypointChanged.Invoke(waypoint);
                }
                if (pathMagic.waypoints [waypoint].reached != null)
                {
                    pathMagic.waypoints [waypoint].reached.Invoke();
                }
            }

            _lastPassedWayponint = waypoint;
        }