No setters, only references to them. It is being called in another while loop, which does get set to false.
But it is weird now, after 20 mins it crashed from something else, nothing to do with this code, last line run from unity crash log was an Ontrigger function, which is fine.
So it is something else causing it but I don’t know what.
The reason I ask is because the value that is being checked is technically outside the loop. You are changing the value on another object then asking that other object of the value later. It may not be your problem at all, but is a good place to look. If there is anything in that object that alters that value (like a getter or setter). It might affect things.
What does the loop look like that is calling the refill ?
Yeah, thanks for having a look though, thought I might of missed something simple, but nope I think it may be an issue with a * pathfinding, so I made some tweaks and I got the game to run for like 40 mins, enemy killed me and no crash! so far…