Hi
I have problem with health variable. I’m making online FPS game and i’m using M2H player script which has those lines
if(hp<0){
theScoreBoard.LocalPlayerHasKilled();
networkView.RPC("Respawn",RPCMode.All);
}else{
networkView.RPC("setHP",RPCMode.Others, hp);
}
It should work just fine, if health is smaller than zero then respawn, but instead it wont let HP go lower than 1. I have no clue why. If i put == instead of < it wont let health go to zero even if damage is 25 hp. Health goes like this then
100
hit
75
hit
50
hit
25
hit
25
hit
-25
Help please if you have any idea.
Thank you.