Hello together,
I have ever dreamt of developing an own fps-game which works over network, basically for playing on LAN partys. I started using Unity for singleplayer games, just playing around and get used to unity. After I found the 3-Part Merry-Fragmas Tutorial (see vid on the end) I finally got a starting point for my first multiplayer fps game.
Its been a while developing now and i stumbled over a lot of problems and this forum was every time a big help to me!
Now im facing a problem which I need your help, because im not able to solve it by my own.
Here’s the Problem:
If “Player A” is shooting at “Player B” a hit-animation is played for every hit until B is getting killed, then a death-animation is played. This works correctly with a knife or a handgun (single shooting), because the time between two shots is long enough.
If Player B is getting shot by an automatic gun, which shoots fast enough, the hit-animation is played, then when B is killed, the death-animation is played and right in the same moment the hit-animation is played again. This appears as the player is gettin hit, tries to die and then again gets hit and doesnt fall to ground.
So I strategy is to disable all hitboxes on the player as soon as the death-animation is played.
The problem is that the hit-boxes are getting disables too late, i think its related to networking-lags.
Maybe theres also another solution for this (like not leaving the death-animation while its played and staying in there which i already tried and failed), im thankfull for every help.
Here is the death-animation-transition:

and heres the hit-animation-transition (which needs to be interrupted by itself):

The logic for getting hit and killed is exactly the same as it is in the Merry-Fragmas Tutorial. Nevertheless i have attached the script which handles the player health (PlayerHealth.cs) and the shooting script (PlayerShooting.cs).
Thanks in advance for your help!
5241941–523316–PlayerHealth.cs (2.99 KB)
5241941–523319–PlayerShooting.cs (26.1 KB)