C
C#8mo ago
Jëskłer

Damage system isn't working

This time I've got a far more precise issue, I'm trying to get this damage system to work however when I implement it the cycle in the script with the bullet goes through properly and the bullet is removed just fine, however the health script isn't working properly, despite having the health set to 3 and the damage set to 1, the loop always goes around and thinks that 3 damage was delievered giving the "You're dead" debug.log, any help on fixing this issue?
No description
No description
7 Replies
Hazel 🌊💃
Hazel 🌊💃8mo ago
$code
MODiX
MODiX8mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Hazel 🌊💃
Hazel 🌊💃8mo ago
From a debugging perspective, how many times do you see your "this is also hitting you" and "you're hit" messages for each interaction? I'm not a unity expert, my thought is that it's a result of the collision being registered on multiple frames before being destroyed.
Jëskłer
JëskłerOP8mo ago
I only see each one time before they disappear and get replaced by the next bullet hitting the player So it'll be bullet hits "You're hit" "You're dead" "This is also hitting you" next bullet hits "You're hit" "You're dead" "This is also hitting you" so on and so forth
jetblacksalvation
are you willing to get on call so that we can collaborate and remove this blocker of yours?
Jëskłer
JëskłerOP8mo ago
Sure, won't have a whole lot of time cause I gotta go to work in 20 minutes, but it could help
jetblacksalvation
vc-0 than
Want results from more Discord servers?
Add your server