Developer Notes

By design - Problem caused by floating point precision errors


'Greater/Lesser Than or Equal To' nodes do not work consistently with values lower than 1

Note: The issue isn't present with whole numbers (ex: 10 decremented by 1)

Steps to Reproduce

1. Open QA-Game
2. Create an actor class bp & open it
3. Create a Float type variable
4. Set the default value for the Float to '1.0'
5. In the Event Graph, create the bp in screenshot #01
6. Set the Float and the Bool result to Watch
7. Compile & save
8. Place the bp into the level
9. In the Details panel > Input > Auto Receive Input > Change to 'Player 0'
10. PIE
11. Press the E key to decrement the Float value

Results: When the Float reaches a value of '.1' the 'Greater Than or Equal To' node fails to recognize that '.1' is equal to '.1'

Note: This setup works correctly with whole numbers (ex: 10 decremented by 1)

Expected: For the value of '.1' to be recognized as greater than or equal to '.1'

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

Login to Vote

By Design
ComponentUE - Gameplay
Affects Versions4.
CreatedJun 8, 2015
ResolvedJun 10, 2015
UpdatedJul 14, 2021