Declaring a Trigger within script?

I want to stop my enemy following the character when its animation isn’t walk. To do this I want to declare the parameter that is being triggered. By doing that, I would use an if statement such as:

if(inRangeParameterHasBeenTriggered){
Stop following the player
}
else
{
Continue following the player
}

^ But obviously with proper code…

Is this a valid way of looking at how to use a parameter to define whether or not the enemy is following?

Wouldn’t it make more sense to turn it around? When the enemy is following the character, then the animation is walk.

1 Like