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
103
S
40
G
23
Posts: 394
Reputation: 20,537

Post » Tue Apr 09, 2013 8:28 pm

The "is overlapping" is a good conditional.
ImageImageImageImageImageImage
Image
B
98
S
21
G
16
Posts: 1,338
Reputation: 21,152

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
103
S
40
G
23
Posts: 394
Reputation: 20,537

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
Image
B
98
S
21
G
16
Posts: 1,338
Reputation: 21,152


Return to How do I....?

Who is online

Users browsing this forum: Kenthria, Maako and 14 guests