Problem with "On Created (instance)"

0 favourites
  • 6 posts
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

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

    What does Construct 2 define as Unused tho?

  • 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.

  • You can also put your unused objects on a different unused layout.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)