"Paused When Disabled" loses current destination

srgfraser

New member
I think you need to add to NavMeshMovement.cs in the Movement Package something like this (probably need some null reference check in the method someplace as well):

Code:
        private Vector3 pauseDestination;

        public override void OnPause(bool paused)
        {
            if (paused)
            {
                pauseDestination = m_NavMeshAgent.destination;
            }
            else
            {
                m_NavMeshAgent.SetDestination(pauseDestination);
            }
        }

so that the Paused When Disabled feature will work properly.

I needed to add something similar to this in my package Behavior Designer for Malbers Animations as my animals on patrol would aways skip a waypoint after a pause.
 
Back
Top