Destroy Single Instance of Bullet/Projectile

For questions about using Classic.

Post » Sun Jun 10, 2012 1:38 am

alright,

so i have wall mounted guns / cannons,
which shoot at given time intervals.

i want to make them so that when they hit a solid object, the bullet will destroy.

it works, but it also destroys other instances of the bullet,
how can i avoid this?
and make it only destroy the instance that is overlapping/"collisionig"?


thanks
B
6
S
1
G
1
Posts: 52
Reputation: 858

Post » Sun Jun 10, 2012 2:23 am

Use the group attribute "Solid" in the condition:

+ bullet: On collision between bullet and "Solid"
-> bullet: Destroy

This definitely only destroys the instances that are colliding.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Jun 10, 2012 2:38 am

do you mean families?
yeah i have the solid objects into a "solid" family.
and what i did was:
bullet on collision with solid, destroy.

but it still destroys all other instances, did i miss something?

on the bullet expressions i only get compare speed, exceeded range, and step
B
6
S
1
G
1
Posts: 52
Reputation: 858

Post » Sun Jun 10, 2012 3:21 am

No, I don't mean families. You can directly test against the attribute solid.

Select the bullet sprite and use its "on collision with another object" condition. On the parameters page click on "pick an object". The list that opens is catagorized. Further down the list you will find the category "Attributes", where you can select "Solid". Of course, this option only appears if at least one of all the objects has the attribute "Solid" (which you can activate under Properties/Groups/Attributes of the sprite's properties panel).
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Jun 10, 2012 4:25 am

oh, silly me, i misunderstood you and kept checking for families,
i switched to the solid attribute, and though it didnt work on the current project, i tried reacreating it in a new file, and it seems to work.

i've uploaded the new example - http://dl.dropbox.com/u/45834687/wallgun.cap

btw what is the practical difference between attributes and families?

anyways, thanks tulamide, always so helpful!
B
6
S
1
G
1
Posts: 52
Reputation: 858

Post » Sun Jun 10, 2012 5:18 am

btw, i redid the layout and it seems to work just fine now,
thanks again
B
6
S
1
G
1
Posts: 52
Reputation: 858


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests