If statement noop :)
I want to make a life sýstem in my game. FX. You have 3 lifes and you die at 0
i tried for a while and came up with this:
when you die Lives() is called to check if you need to die or just loose one life but this code just take all your lives at once. how can i run this if statement once until lives() is called again? Thanks!
public void lives() {
if (lives > 1)
{
lives--;
}
else Die()
Comment
This function is being called more than once for some reason. There's no way for us to know what that reason is without seeing more of your code, but you can use Debug.Log() in a few places in your code to try and figure out the earliest part of your code that's being called more than it should be.