variable++ leads to first increment applied twice

I have created this blueprint to control a variable with mousewheel. It all works as intented, however when the variable is at zero, the first mousewheel up turn will always apply the increment twice. So for example instead of going in a 0 10 20 stepping it goes 0 20 30 40.

And I do not see why this is happening.

Here is a screenshot of the blueprint:

You don’t appear to be using the Increment/Decrement nodes correctly.

The diamond pin indicates that the variable passed in will be passed by reference.
The Inc/Dec nodes use that to change the value of the variable passed in permanently (Equivalent to x = x + 1 etc.)

I examined the code after reading your post and changed it to not use the increment operators and now it works. Thanks

1 Like