Multiple click DC

Double folding.skp (369.6 KB)
Hello,

Attached an example of 4 panels which will be activated by an onClick command.
At this moment onClick activates the folding of the 1st two panels and changing positions of the last 2 panels.
Somehow I need these last 2 panels to fold as well, but ONLY on the 2nd click.
Sounds easy (and maybe it is) , but I can’t figure it out right now.

Any ideas?

Then “these last 2 panels” need a 0 rotation in their animate() for the 1st click.

Bed with two folds that have independent onclicks, with a test to check position of the first.
the move is tied to the second fold. (seems more sensible and works without interfering with other geometry)

folding example.skp (128.0 KB)

It may be enough or give you some ideas

You could consider a Set function for conditions, required if are placing the animate in the parent

Thank you for the effort you both put into this.
I indeed tried to use the SET function, but did not succeed in reaching the end goal.
pcmoor , the 2 folding is indeed how it should look like at the end, however the 2nd set has to be dragged with the first folding to begin with and only fold at the 2nd click.

See below movie until 1m:20s
https://www.youtube.com/watch?v=k9tIdsTPx0Y

That is exactly what I need to create.