Problem with "On Created (instance)"

Get help using Construct 2

Post » Mon May 27, 2013 8:00 pm

Hi,

Im making an event where "On Created" Object1, the game creates Object2 a certain distance from it.

But to actually have Object 1 as an active sprite on the Layout, I need to paste it somewhere off the layout, where it won't be seen.

The thing is, the game creates that instance on game run, so that it immediately also spawns Object2. And I don't want that.


How to make it create Object 2 on Object 1 Created, besides the initial spawn on layout start?
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Mon May 27, 2013 8:12 pm

On start of layout - Destroy all unused objects.

I do this with almost all of my projects, anything outside of the layout, I destroy it on start of layout, just to clean up before things start.

B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Mon May 27, 2013 8:38 pm

Oh, didn't know about that one. Useful! Thank you very much! : )

What does Construct 2 define as Unused tho?Xionor2013-05-27 20:38:43
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Mon May 27, 2013 9:45 pm

Well, construct 2 doesn't really define that, I do.

For me, anything that doesn't start off in the layout I usually create during the game code, so it's not needed. Construct 2 just expects all those object when you load up the game, but once your layout actually starts, they don't all need to be hanging around off screen.
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Tue May 28, 2013 12:20 am

You can also put your unused objects on a different unused layout.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Tue May 28, 2013 1:20 am

Yeah, I have all my assets in an asset layout. Keeps things clean when code is generating most of the objects in the other layout.Thndr2013-05-28 01:21:01
B
21
S
8
G
6
Posts: 346
Reputation: 4,891


Return to How do I....?

Who is online

Users browsing this forum: Nicolas951, Shenkai the ssj and 28 guests