MarineDEMAISON
11 months agoCommunity Member
Count how many objects are in selected state with an incremental variable
Hello, I have an object with a hover / selected state. I've used auto states to select / deselect when I click on an object.
I want to increment a variable when I click on this object to put it in the selected state, and to decrement it when I put it back to the normal state.
My triggers so far :
Trigger #1 : increment the counter variable by 1 when I click on the object, if the state = selected
Trigger #2 : decrement the counter variable by 1 when I click on the object, if the state = normal
For it to increment, it seems that I have to use the target (resultant) state of the click, not the initial state ... but sadly the decrementation does not work at all.