# Are logical operations broken in UE 5.6.1? 

**URL:** <https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078>\
**Category:** Blueprint\
**Tags:** bug, unreal-engine, bug-report, Blueprint, question\
**Created:** [August 26, 2025, 1:06pm UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078 "2025-08-26T13:06:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![X1nto1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@X1nto1](https://forums.unrealengine.com/u/X1nto1)\
**Post date:** [August 26, 2025, 1:06pm UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078/1 "2025-08-26T13:06:00Z")

</div>

I’m adding basic scrollwheel hotbar selection mechanics to my game. The way I do it is by storing the current item in a variable, getting the scroll wheel axis (either 1 or -1), finding the index of the current item in the inventory, then incrementing the index by the returned scroll axis. However, I’m getting weird logical errors where 0 \>= 0 returns false:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/f/abf89f9dc54ec270f3a6be870a4ae11878e69c14.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/2/1a2a0af6c062b6fba349d63c4ef4366dac4d3c68.png)

and 3 \< 3 returns true:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/a/99abbfa0564afa18b2d905a3ad8591465d6b68b0.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/d/dad3c40a9329124740e60de491fdeaeea82c74f3.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/0/dd0ff65bdff1b214a3683a222e336cc33c48b5d2.png)

Here’s the whole setup:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/8/0683458526bb023465e7d6379efab4a3205890bf.png)

What’s weird is that if I flip the logic and use OR instead of AND, everything works:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/f/22fc693e13c5879b6a498ae1400cb3e76fbd3a85.jpeg)

Am I missing something?

---

<div class="post-metadata">

**Author:** ![LegendGary](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendGary](https://forums.unrealengine.com/u/LegendGary)\
**Post date:** [August 27, 2025, 2:41am UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078/2 "2025-08-27T02:41:10Z")

</div>

Do you have default Selected Spell?  
Find and empty Selected Spell probably will return 0?  
and if you scroll +1, it will not be greater than or equal to length  
it return false

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [August 27, 2025, 8:24am UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078/3 "2025-08-27T08:24:25Z")

</div>

Variable values ​​may not be displayed correctly (at first glance).

You need to set a breakpoint one step later so that the branch “calculates” all variable values.  
The most reliable way is to use Print String for viewing.

---

<div class="post-metadata">

**Author:** ![X1nto1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@X1nto1](https://forums.unrealengine.com/u/X1nto1)\
**Post date:** [August 27, 2025, 9:55am UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078/4 "2025-08-27T09:55:35Z")

</div>

Yes, I do have a default spell selected and it’s one of the inventory items. It’s never an invalid spell.

---

<div class="post-metadata">

**Author:** ![X1nto1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@X1nto1](https://forums.unrealengine.com/u/X1nto1)\
**Post date:** [August 27, 2025, 9:56am UTC](https://forums.unrealengine.com/t/are-logical-operations-broken-in-ue-5-6-1/2651078/5 "2025-08-27T09:56:47Z")

</div>

I do have the breakpoint set “one step later” (see the Branch node in the last two screenshots)
