How do I check if an object is not existing on the layout?

Get help using Construct 2

Post » Mon Aug 22, 2016 8:49 am

Hi everyone,

I'm looking for the cleanest way to trigger actions if a given object is currently not existing on the layout. I don't know any existing conditions to check that, so what I generally do is:

(If I know there is no invisibility going on)
- Object is visible > (no actions)
- ELSE > (whatever actions I want to do)

I also sometimes do it with "is on screen", but it's not clean. If the object is on the layout but outside of the screen boundaries and invisible, it will not work.

Am I missing a simple action to check that, or is it a cleaner way to do it?

Thanks! :)
B
40
S
10
G
1
Posts: 369
Reputation: 3,478

Post » Mon Aug 22, 2016 9:26 am

Object.count should return 0 if you don't have any object on the layout.
Image Image
B
28
S
17
G
160
Posts: 894
Reputation: 83,261

Post » Mon Aug 22, 2016 9:40 am

Awesome, exactly what I was looking for! Never thought about using this. Thanks a lot! :)
B
40
S
10
G
1
Posts: 369
Reputation: 3,478


Return to How do I....?

Who is online

Users browsing this forum: Slug101 and 12 guests