Sorry, it was hard for me to word the question in the thread title.
I’m assuming this would be done similar to how health reaching zero would kill the player.
How would I make it so that
a) the player hunger bar will decrease over time, with an exponential effect to it, meaning the hungrier you are, the hungrier you get.
b) after x amount of time not eating food (which might be as simple as clicking an item on the gui in the player inventory), player will die
c) if possible, could you explain how I could make a debuff after X amount of time not eating? im sure this would have to tap into other character stats, or it could use a more basic stamina drain increase (so the player cannot sprint for as long, etc)
what if i wanted to do one for thirst? i was thinking the same thing with a GUI, with a canteen in the inventory. however for this i would need
a) player interacts with object in the game world (barrels of water, a river, etc), canteen fills up.
b) player drinks, thirst bar fills 1/4, canteen empties 1/4 of its “charges”
c) thirst bar decays at X rate with an exponential effect
d) thirst bar reaches zero kills player
Also, if you could recommend any c# books or tutorials that you think are very effective, I would greatly appreciate it! ![]()
Thanks, I hope someone out there likes answering these types of questions. I would pay someone to do small time coding for me if I had to (if I could not learn it myself)