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
122
S
50
G
24
Posts: 401
Reputation: 22,462

Post » Tue Apr 09, 2013 8:28 pm

The "is overlapping" is a good conditional.
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

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
122
S
50
G
24
Posts: 401
Reputation: 22,462

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
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817


Return to How do I....?

Who is online

Users browsing this forum: Bobbyneal100, mikehive, newt, tinhofiel and 44 guests