Maybe you want to change those lines in your next update, so it is easy to get the enemy AI-character moving in all directions while aiming:
at the script "NavMeshAgentMovement" at Line Nr 70, inside the IF with the comment "// Only move if a path exists."
From:
To:
strafing can then be enabled by setting the NavMeshAgent.updateRotation to false and re-enabled by setting it to true.
As an alternative you could add this kind of bool statement inside the ability itself.
Otherwise the AI, despite the path, moves straight at the player (in aim direction, while aiming of course), ignoring the NavMeshAgent.Destination entirely.
at the script "NavMeshAgentMovement" at Line Nr 70, inside the IF with the comment "// Only move if a path exists."
From:
C#:
lookRotation = Quaternion.LookRotation(m_NavMeshAgent.desiredVelocity, m_CharacterLocomotion.Up);
// The normalized velocity should be relative to the target rotation.
var velocity = Quaternion.Inverse(lookRotation) * m_NavMeshAgent.desiredVelocity;
To:
C#:
Vector3 velocity;
if (m_NavMeshAgent.updateRotation)
{
lookRotation = Quaternion.LookRotation(m_NavMeshAgent.desiredVelocity, m_CharacterLocomotion.Up);
// The normalized velocity should be relative to the target rotation.
velocity = Quaternion.Inverse(lookRotation) * m_NavMeshAgent.desiredVelocity;
}
else
{
velocity = m_NavMeshAgent.desiredVelocity;
}
strafing can then be enabled by setting the NavMeshAgent.updateRotation to false and re-enabled by setting it to true.
As an alternative you could add this kind of bool statement inside the ability itself.
Otherwise the AI, despite the path, moves straight at the player (in aim direction, while aiming of course), ignoring the NavMeshAgent.Destination entirely.