It’s absolutely possible!
The general approach is this:
Your doors need to exist in 3 - let’s call them “states”:
- Cabinet Closed
- Door Open, but not retracted
- Door Open and retracted.
Create a custom attribute: Door_State
Door_State will hold one of the above 3 values. But you won’t change the door state directly! Instead, your “OnClick” action will be
When you use the interact tool, each click will change the state:
First click changes state from 1 to 2
Second click changes state from 2 to 3
Third click changes state from 3 to 2
Fourth click changes state from 2 to 1
You’ll need to reformulate your door rotation and position attributes to be one that makes a decision based on the value of “Door_State”.
For states 1 and 2, the only differences will be in the rotation of your door. State 3 gets the same rotation as state 2. Since only State 1 has a rotation of zero, set your rotation attribute to something like “=IF(“Door_State”=1,0,90)”
For states 2 and 3, the only differences will be in the POSITION of your door - and state 1 gets the same position as state 2. Since only State 3 has a position equivalent to “retracted”, set your position attribute to something like:
=IF(“Door_State”=3, <y position when retracted>, <y position otherwise>)
I leave the implementation to you.