Float Value not changing?

82474-the-value-that-will-change.png

Hi all, I’m having a bit of an issue. I’m trying to create a combo counter for my game, and when I use the normal attack (left click) the value increases. This seems to be working just fine, when I left click, the value goes up.

However, when I try with the counter, the value does not increase.
The first image I have posted (The one that starts with the comment Warning to dodge), does not want to change the value. However, the TimeUntilAttack resets to the orignalTimeUntilAttack, the player teleports to the enemy, and the comboTimer resets to 5. But no matter what I do, the comboCount will not increase.

In the second image (The one that starts with the comment attacking), the comboCount increases perfectly fine.
I’m a little bit lost here, and I think it has something to do with TimeUntilAttack, as that’s the only reason the comboCount won’t increase.

Just found the answer. So I printed the time for the TimeUntilAttack, and I found out that because each of my enemy objects have a different value, for some reason they all add up together, so instead of having to wait 4 seconds, I would have to wait 30. I am probably making no sense at all at this point, but I just thought I should say I figured it out :)

Sorry I am new to C# and Unity for that matter, how would I go about doing this? Thanks again

1 Answer

1

Just found the answer.

So I printed the time for the TimeUntilAttack, and I found out that because each of my enemy objects have a different value, for some reason they all add up together, so instead of having to wait 4 seconds, I would have to wait 30.

I am probably making no sense at all at this point, but I just thought I should say I figured it out :slight_smile:

for example, attach it from the inspector or look in the documentation gameObject.find