How to destroy pinned object?

Discussion and feedback on Construct 2

Post » Thu Jul 25, 2013 11:40 pm

For example:

I have multiple items "tanks" and every tank has pinned object "turrent".

Turrents are pinned to tanks.

Tank is main moving object and if I destroy tank object then turrent object remains to screen. How to destroy specific tank turrent?

B
5
G
1
Posts: 12
Reputation: 897

Post » Fri Jul 26, 2013 1:55 am

ImageImageImage
B
71
S
21
G
229
Posts: 3,687
Reputation: 128,338

Post » Fri Jul 26, 2013 10:33 am

In the past I just destroyed all unpinned, it cleaned it all up. (That was before containers)
B
230
S
62
G
33
Posts: 902
Reputation: 40,319

Post » Fri Jul 26, 2013 6:39 pm

I still use UIDs instead of containers a lot. I can do stuff like destroy the turret but leave the tank alive for a few seconds before also being destroyed. It takes a little extra effort, but I always end up needing that freedom at some point.

Just make an event that says: 'on tank created > tank spawn turret > set turret variable 'id' to tank 'UID''.
Then: 'on tank destroyed + turret.id = tank.UID: destroy turret'

But really if you are just making something simple, use containers.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007


Return to Construct 2 General

Who is online

Users browsing this forum: Jayjay and 9 guests