Boolean is being set to true and false on every frame even tho i havn't set up such thing

guys I’m doing some kind of hide and seek game where the player can hide in some places and to do that I’m using a boolean to determine whether the player is hidden or not but whenever i check the boolean in event tick it looks like its being set to false and true everyframe. why is this happening?

Annotation 2021-06-09 213554

i need to mention the boolean is being reported as false before i interact with anything but as soon as i press e to interact it does such thing

Based on what you provided I can only guess that the InputAction Interact pressed condition keeps firing. You should add a break point or print some string every time it’s pressed. To make sure it’s not on a loop for some reason.

i checked it with print string and its not looped. it only prints once its pressed

Then the issue must be somewhere else. You must be updating the boolean in another place.

if you look at the last screenshot it clearly says that its been modified in two places and that is the if statement. and i dont even use any tick event on any of my blueprints how could this happen? i will provide screenshots of the entire blueprint maybe its something there

this is the entire code in this blueprint and the boolean is not being used anywhere here.

What happens if you remove all the nodes from Interact pressed. So basically you don’t set Is Hiding? anywhere at all. Does it still change values?

i disconnected the node and it remains false so the problem is definitely here i just don’t understand how.

pls note that this happens while I’m hiding under the bed so it’s being set to false and true every frame but as soon as I execute the unhide functions it’s set back to false again.

i was able to fix the issue by deleting the boolean and re creating it. i think it was being used from somewhere which I forgot I about.