No Death on 0HP

Report errors found in any assets.
Post Reply
User avatar
mikalburrows
Contributor
Contributor
Posts: 36
Joined: Tue Nov 05, 2019 4:10 pm

If a player is hit for exactly how much health they have they will be put to 0HP but no death occurs.
(see screenshot)

Image

I am able to replicate this fairly easily. I changed sniper damage to 35. I hit player twice with sniper to put him at 30HP and then let him regain health till 35HP and hit the player one last time and he will be at 0HP but no death occurs.
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

I see,
the condition to die is if health <= 0, so if the player is not death that means that health is not 0 but a fraction of 1 cuz health value is a float variable,
an easy fix for that is change the condition to if health < 1, to do that go to bl_PlayerDamageManager.cs -> void SyncDamage () -> at the bottom of the function replace this code:

Code: Select all

 if (health <= 0)
for

Code: Select all

 if (health < 1)
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
mikalburrows
Contributor
Contributor
Posts: 36
Joined: Tue Nov 05, 2019 4:10 pm

Lovatto wrote: Fri Nov 15, 2019 7:40 am I see,
the condition to die is if health <= 0, so if the player is not death that means that health is not 0 but a fraction of 1 cuz health value is a float variable,
an easy fix for that is change the condition to if health < 1, to do that go to bl_PlayerDamageManager.cs -> void SyncDamage () -> at the bottom of the function replace this code:

Code: Select all

 if (health <= 0)
for

Code: Select all

 if (health < 1)
Thanks was an easy fix.

Also I am having a problems with Looping animations only for the machine gun rifle after adding a new player model. All other weapons work fine but it loops between equip and no weapon. PLEASE HELP.
Post Reply