Reply To: Could you go into if (damage >= currentHealth) { is for? Won't this lead to the player dying prematurely – while…

Forum Archive Could you go into if (damage >= currentHealth) { is for? Won't this lead to the player dying prematurely – while… Reply To: Could you go into if (damage >= currentHealth) { is for? Won't this lead to the player dying prematurely – while…

#25042
Jonathan Gonzalez
Participant

    I just tried it out myself to see what you were talking about. I’m not entirely sure why it jumps like that, but removing the “=” seems to fix it. The reasoning for using that was in case the damage was exactly the same amount as the currentHealth we’d also die, but it seems it causes an issue with it. Nonetheless just the “>” works as well. If you know why this happened I’d like to know as well.