< not working

Hello guys. I’m following a youtube RPG tutorial and on the Mana I kind of went my own way with it and paused the video it all seems to be working great, when I cast a spell the Mana loses 0.1 points, I have a < set so if Mana is less than the cost of the spell the script will run (false)

The problem is it will stop at 0.1 Mana and won’t go down to zero. Been trying to figure this out but I can’t. Any help would be appreciated am a n00b.

Could you put a screenshot of your setup? I did a quick one that I imagine yours might look like. This runs until mana = 0.

Ok, so I changed the Mana var to 100 instead of 1 and everything associated with it and that works well. But doesn’t work with in .1 oh well. Now my problem is the HUD bar doesn’t follow the value till it reaches 0

Thanks for replying. I’m not sure how I can get the code in, it is very messy and long. I have figured if I put the figures to 100 - 10 instead of 1 - 0.1 then it works perfectly and won’t cast the spell when it is under 10.

The only problem with that is the progress bar doesn’t work doing it like that

I also noticed when I used 100 - 10 it went down to 0.00 where as with 1 it will go down to -0.00 (when not using a condition)

Ok, so I just edited all the rest of the code off to give the simple version of what I have. It will not go past 0.1 though.

Mana = 1
Healmana = 0.1

I just uploaded a pic above thanks for your help.

from the screenshot, if your Healmana = 0.1 always, then based on the condition, it will never reach 0. Mana will always stop at 0.1. You need to set your condition to Mana < 0.0 based on the screenshot

Thanks, I tried that but if I put mana to 0.08 and then cast the spell the mana drops to -0.02.

From what I see mana should take away Healmana till mana is less than Healmana.

So Mana is stopping at 0.1 (which is the same as Healmana value) but as it is set to less than shouldnt that put it to 0?

When I set the values -
Mana 100
Healmana 10

it works perfectly?

Ok…
So I have now set the values to
Mana 100
Healmana 10

Then in the HUD mana function I divided Mana by 100 and now it works perfectly and shows on the HUD.

I don;t understand why it is not working with 1.0 - 0.1 still but otherwise I have got a bypass for it.

So Mana is stopping at 0.1 (which is the same as Healmana value) but as it is set to less than shouldnt that put it to 0?
You’re right but for some reason it doesnt work. It’s not working for me either. This seems like it might be a bug

I have been pulling my hair out for hours over it haha least I have a pass for it at the moment. Thanks for your help mate

Try a <= node.

On a side note, personally I think it’s logically easier to read from the true part of the branch, so I’d switch it around. If mana is >= healmana do stuff.

Hope you get this working.

<= will not work because that will be true when mana and healmana are the same.

I have got it working, I had to x the values by 100. So Mana = 100 and heal mana = 10.

So it is a bug for some reason as it should work with 1 and 0.1