[Solved] How do I destroy one object in a familie?

Just started using Construct 2? Post your questions here

Post » Mon Dec 22, 2014 5:26 am

hey,

I got a familie called "Balls" and there i have just one sprite called for example "red".

Now when i say spawn "Balls" on a ghost sprite, i get spawned a "red" Ball. After 1sec i say spawn "Balls" again and get another "red" Ball.
Everything works fine, but when i say "Balls"on colisson with "Goals" (another familie) -> destroy , it destroys all my red balls.
I want it just to destroy the "Ball who touched the "Goal" and not all.
314234.png
You do not have the required permissions to view the files attached to this post.
Last edited by EyeForcz on Mon Dec 22, 2014 12:04 pm, edited 1 time in total.
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615

Post » Mon Dec 22, 2014 5:38 am

You need to pass the Balls.UID to the function. Also, using 'Balls' without any previous picking, just picks a random instance from the Family.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 5:42 am

i understand but i dont know how to implement it, do you have a sample for me?
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615

Post » Mon Dec 22, 2014 5:49 am

Something like this

Balls: On collision with Goals -> Function: Call "Dead" (Balls.UID)

Function: On "Dead"
Balls: Pick instance with UID Function.Parameter(0) -> Balls: Destroy
etc.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 6:04 am

453345435.png


doesnt work :/
You do not have the required permissions to view the files attached to this post.
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615

Post » Mon Dec 22, 2014 6:28 am

Pick Balls "with UID" Function.Param(0)
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 22, 2014 12:04 pm

thanks worked fine :)
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 4 guests