[Solved] Double spawned objects. Solution?

Get help using Construct 2

Post » Tue Aug 11, 2015 2:05 am

I have an event where

Object A:On collision with object B, set all objects on layout destroyed.

I have about 5 different objects on the layout and I put them in a family, where I can destroy them on collision.

When I restart the layout after that, Object A is spawned twice immediately, instead of just one.

Is there a solution to this? I thought I already destroyed all objects before the layout restarts.
Last edited by mrneko on Tue Aug 11, 2015 10:02 am, edited 1 time in total.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071

Post » Tue Aug 11, 2015 3:56 am

Do you have one instance of the object sitting on the layout to begin with before spawning the others?

If so make sure you do a

on start of layout - object destroy

to clear all instances first.

its probably just one of your original instances still on the layout
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Post » Tue Aug 11, 2015 10:03 am

I sort of came up with a workaround. Basically assign a global variable to them and disable events following collision. That solved the issue in my case. Probably not the best way but it worked somehow.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest