[Solved]How do I destroy the exact spawned sprite?

Get help using Construct 2

Post » Tue Aug 04, 2015 10:01 am

Hi,

I need to destroy a bullet that is coming (spawning from enemy) . When I simply add destroy bullet weapon, it simply destroys all spawned items. I am not able to pick the exact one,

How to do it?

Thank you,
Last edited by vijayrajesh on Tue Aug 04, 2015 11:31 am, edited 1 time in total.
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 10:04 am

ad a subevent and pick by UID
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Tue Aug 04, 2015 10:13 am

Do I have to give any value to UID?
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 10:14 am

bullet.UID
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Tue Aug 04, 2015 10:17 am

I could pick the UID, but when I add action "destroy bullet" now it destroys every bullet.
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 10:18 am

http://i.imgur.com/CPYNIIO.png?1 Please see this image
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 10:26 am

enemy bullet on collision with player should be enough to pick only the bullet that collides..

Please explain what is not working..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Aug 04, 2015 10:28 am

I agree with you LittleStain. But in my project, it seems to destroy all enemybullets on destroy. Let me see whether I can share the capx please,
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 11:21 am

@LittleStain Please download this capx and you can see on collision it destroys all the bullets.

on the game load please use arrows to move the main player,

https://dl.dropboxusercontent.com/u/131 ... 0test.capx
B
9
S
2
Posts: 59
Reputation: 763

Post » Tue Aug 04, 2015 11:25 am

I thought so, but wasn't sure..

In the function "onCollision" there is an action to destroy enemy bullet..
This enemy bullet is not referenced so all enemy bullets are destroyed..
The action doesn't seem nescessary and can be removed, removing your issue..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], tarek2 and 14 guests