And / or other conditions

Hi there,
I am new to GDevelop, and I want to create the following situation within one scene:

When the cursor/touch is on the object X, and the cursor/touch is on the object Y,
then show a layer with name “Layer 2”.
What I mean by that, is when the user is touching the objects one after the other,
and not at the same time.
I can not figure out how I have to structure the condition (the right order of commands and subevents) in the event editor.
Does somebody knows a simple way to achieve it ?

Use on condition to check for the object being touched, then create a sub condition under that to check for the next touch condition for the next object being touched.

Sub-events won’t help if you want to touch one object first, and then another.
When the first object is touched, change a variable ObjectHasBeenTouched to 1.
Then use that variable as condition along with the condition for the second object.

Best way is to assign an object variable like @Gruk says so when you touch x object change to 1 or “touched” if is a text variable. Later in a foreach check all objects if 1 or “touched” then do stuff.
There is no need to do it in a foreach but may come in handy sometimes.

As mentioned above, using a variable is probably the best way as far as I know. So you do

Condition: Cursor is on Object 1
Action: Change “ObjectTouch” (or whatever you want to call your variable) to 1.

Condition Cursor is on Object 2
Condition. ObjectTouch (your variable) = 1
Action: Show Layer 2.

Something like that…

Thank you for your nice advice!
I manage to do it correctlly.

Thank you for your advice and support!
I manage to do it correctlly.