|
Post by erikvonweishaar on Apr 8, 2024 18:51:25 GMT
Not sure what I did setting this up. All the swimming stuff works great but after the stamina has drained, character instantly dies. I've changed the Health/Stamina Consumption to 1, but that hasn't fixed it. Character has 100 health. If you have any ideas or need more information, please let me know.
|
|
|
Post by Invector on Apr 26, 2024 20:58:46 GMT
Indeed the character is dying instantly because we're calling the method ChangeHealth which sets the currentHealth to value, while the ReduceStamina has a bool option called accumulative and slowly reduces the value (currentStamina -= value * Time.fixedDeltaTime;)
To fix that you can create a method similar to ReduceStamina and call it ReduceHealth
|
|