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

Discussion and feedback on Construct 2

Post » Tue Jun 24, 2014 6:54 pm

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?
B
7
S
2
Posts: 16
Reputation: 771

Post » Wed Jun 25, 2014 10:30 am

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.
B
7
S
2
Posts: 16
Reputation: 771


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 15 guests