I’m working on a control rig, and to limit rotations i needed a rounding function that rounds to the nearest multiple of X. See following blueprint/control rig function.
When testing with this simple setup
I found that the function always outputs 0 for negative numbers. I was very confused, and decided to watch the output of the greater equal node in the function (right click on result → Watch Value) - which immediately fixed the problem.
This is consistent behavior: while the value is monitored in the debugger, the function works as intended. When its not, it breaks down and always outputs 0 for negative inputs.
I don’t understand why watching the value in the debugger changes code behavior, and i would expect that to not happen. Whats going on?
How can i get my function to work without having to watch the value in the debugger?
Unreal Version: 5.1 System: Win11