Possible float == 0.0 bug in blueprints?

I cannot work out why this branch is evaluating to false when from what I can see it should be true.

Is this a bug?

Maybe there’s more precision after the 5th digit that you don’t see
You can see example here : A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

As a rule of thumb never compare float with ==, always lead to weird errors.

Try using the IsNear (or IsNearZero in your case) so you can add error tolerance to your ==

1 Like

Thanks

I thought the debug output would show the exact value but perhaps not. Logic wise I’m fairly sure the value should be exactly zero at that point in the blueprint.

I’ll look into those other nodes you’ve suggested or else try to change the blueprint logic so that the checking for zero isn’t required.

Wish there was a double type variable for blueprints. Floats are a pain in some cases.

Thanks for you help.

I’ve been getting a headache wondering why 0.0 != 0.0. lol I used the round function and now it works. Thank you