A.I That tracks the player then resets

I’m making a game where you tend to a campfire to keep an enemy away. My problem is that since the player is stationary I need the A.I to Track the player and get closer the lower the fire becomes then resets if it gets higher, how would I go about doing this?.

Try doing navmeshagent.stoppingDistance = campfireValue/or something else
@Frobegames