On Created - not all instances in layout exist when fired??

0 favourites
  • 2 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I assumed something that I expected the engine would do... any advice or opinions would be great.

    I'm a seasoned Unity user and expected the following:

    When using the On Start Of Layout condition I would expect it would not be fired off until ALL instances in the scene were created first... an example:

    I have a player sprite and two other sprites in the layout - one called "start_position_A" and the other "start_position_B"

    I have an event sheet which contains the "On Start Of Layout" condition.

    When "On Start Of Layout" is triggered there is a global variable test, depending on the outcome it either chooses

    "start_position_A" or "start_position_B" - and uses the position coords to place the player.

    when testing sometimes it worked, sometimes it didnt. Thats because sometimes the instance being referenced existed and sometimes it didn't. I added a wait 3 seconds action - it worked EVERY time, because by then the instances existed.....

    So, does anyone else think that "on start of layout" should not be fired off until ALL instances have been created in the layout?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • turns out to be a different problem - if the player is holding down a direction control key when the layout is changed, the physics system seems to detect this before the event has chance to place the sprite in the start location - making the sprite sometimes appear in the wrong location.

    Solution - for about 0.3 of a second disable player input when layout starts.

    Seems like a hack to me. But it works. For now.

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