Trying to make an AI hunger and eating system

I want a group of sheep to roam around randomly within the characters proximity, and while they do randomly stop and eat. I have gotten them to move, not fluidly yet but where I am absolutely stuck is making them stop and eat.

I have made an internal system for hunger but no matter how I mess with it I cannot make them stop eating and roam again because hunger replenishment is broken. I assume I am calling things in wrong order or something.

Can I suggest another method for doing this?

Hey Vaei, thanks for the suggestion. I tried it out but it also doesn’t quite seem to work the way I need it to. The hunger float is what seems to continue to be the problem.
Hunger properly goes from 1 to 0 to 1 now, however it would be nice if I could make it pause on 1 or 0 for a period of time.
The ‘Stop Animation’ is definitely going to help, though I can’t seem to make playing the eating animation wait until movement has stopped. Also Stop doesn’t seem to fire on 0, the movement starts up again however the eating animation still plays.
Thanks for the help so far, hoping you have some more suggestions.

Of course. You are going into Hunger code on Event Tick. It has nowhere else to go. I suggest adopting Behavior Trees instead of your current approach. Also, watch this series, they implement Behavior Trees, Hunger system and more.

Actually I have given that a watch, and although entertaining, I found it very hard to follow. I’m sure it’s very comprehensible if given enough time and patience. So now that I’ve learned a little on my own about what to do and what not to do I might give it another go.
Thanks for the suggestion Nick.