Hit any object

Get help using Construct 2

Post » Tue Apr 09, 2013 8:12 pm

How verify if object A has hit any object in the screen.
I asking that because I need to destroy a object A if it hit any object in the screen including floor, walls, enemies, main character and so on.
B
85
S
31
G
22
Posts: 384
Reputation: 18,592

Post » Tue Apr 09, 2013 8:28 pm

The "is overlapping" is a good conditional.
ImageImageImageImageImageImage
B
93
S
20
G
12
Posts: 1,211
Reputation: 18,473

Post » Tue Apr 09, 2013 9:51 pm

I know but I don't want to test all of the objects in the screen. I want to test only one time. Something like:
- If objectA hit ANY object
- destroy objectA
B
85
S
31
G
22
Posts: 384
Reputation: 18,592

Post » Tue Apr 09, 2013 10:05 pm

use the "trigger once while true" and put the objects what you want to test inside a family, or make one check for each object.

You can use an instance variable ID to meet the exactly object you wanted check too. Ready these tutorials, it will help: https://www.scirra.com/tutorials/355/making-character-composed-of-multiple-parts
https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail/revisions
ImageImageImageImageImageImage
B
93
S
20
G
12
Posts: 1,211
Reputation: 18,473


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests