Open Noah4ever opened 3 months ago
Bug with agent slowly start walking again after he got paused. Try saving the agent velocity (https://docs.unity3d.com/ScriptReference/AI.NavMeshAgent-velocity.html) when the simulation gets paused and set the velocity when it resumes. @juliuse98
Example:
void pause() {
lastAgentVelocity = agent.velocity;
lastAgentPath = agent.path;
agent.velocity = Vector3.zero;
agent.ResetPath();
}
void resume() {
agent.velocity = lastAgentVelocity;
gent.SetPath(lastAgentPath);
}
Implement the
Move()
andAttack()
method.Reminder of how it works: Squirrel has method
doAction()
in whichMove()
andAttack()
gets called