"Latch" type logic gate

Greetings!

I am attempting to perform a “latch” type of logic gate which would stick a boolean value to true even when the switch in question has turned off, until another boolean “resets” it to false.

I did find an 5 years old topic on Stack Exchange (dunno if I can post it here, so I won’t post it here), but as it is with most older forums about blender, nodes and menus have changed so much, they do not work any longer.

In fact, the current issue compared to the old forum is that the boolean attribute doesn’t seem to store correctly, so even when turn on the first switch (supposedly store named attribute should “remember” it set to true) and turn it off, the information doesn’t stick, so the boolean becomes false immediately.

This is preventing me to proceed to the next phase which I need for animation. I need to drive a shader value in a way that it interpolate to increase, reaches a top threshold, and sticks to such threshold until reset by a bottom threshold, ready to interpolate again.

I already know how to perform this, but I can’t make the “hysteresis latch” (name according to a UE5 programmer friend who however doesn’t know how to program with blender nodes) to work, so I’m stuck.

I don’t need to do this specifically with GNs. Even a driver would be okay. However, at this point I’m curious to understand why “Store Named Attribute” isn’t working as intended.

Thank you in advance for anybody trying to help. ^^

Simulation nodes are your best bet: otherwise, Geometry Nodes (and Blender overall, for the most part) doesn’t know the past and only looks at the current frame.

Something like this should be able to handle your logic (also a plot using the x-coordinate in place of time, too:)

Hysteresis demo - Geometry Nodes - 5.3 - 2026-08-04.blend (158.5 KB)

Here’s the actual time-dependent part:

And the plot and the no-hysteresis comparison:

So you can see how the output traces the underlying variable:

Man, what would I do without this community. o.o;
I hope one day I’ll be able to make exhaustive replies such as this one so that I can somehow pay back!

Thank you so much for this and for making the demo file! This is great! ^^