Hello guys, I’m kinda newbie in Unity scripting, but I’m already reading all the tutorials I can to create my game… Everything went well so far, but then I tried to make my first code ever: a hunger script… I have the theory but I don’t know how to put it in codes!
My idea was setting an “int” var to the player, named “Hunger”, and set it a initial value like 10 or something like that
So there would be an infinite loop that updates every minute or more (I think in this case I would use WaitForSeconds to set the time between each update, but I’m not sure please help me)… everytime this loop updates, it would subtract 1 from the Hunger variable, to do this I think I would use something like this:
if (hunger >= 1);
WaitForSeconds(60);
hunger -= 1;
Anyway, guys, I’m kinda lost here, I don’t even know where to start, so please help me here D:
I’m a complete newbie but I wanna learn so if you guys reply with your codes please tell me how it works so I can learn from it