0 Favourites

Why does this happen?

  • Hello, I do not understand what is happening here, why the X coordinate of sprite is not positioned ?.

    The X coordinate is always 0, never is 50 or 100 or 150 or 200.

    https://dl.dropboxusercontent.com/u/60803633/test2.capx

    Someone could take a look?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I dont think that event system works in 'on start of layout'.

    Do it simple. Set X to choose(100,150,200,250) in the creation action.

  • working

    edit:

    or add sub-event

  • But I do not understand, why this is so ?.

  • Well, am not 100% sure, but. I think that a newly created instance actualy gets created in the next tick.

    You can apply actions to a newly created instance, right after a "Create" action, but you can't do picking of that instance before the next event.

    But the 'on start of layout' does not execute in the next tick. This makes the pick events beeing skipped.

    There is a simple trick to know if your 'on start of layout' has a problem with picking. And that happens a lot if you are not carefull. Change the 'on start of layout' to 'on mouse clicked'. If it works now, you need to bring the events out of the 'on start of layout'.

  • Well, am not 100% sure, but. I think that a newly created instance actualy gets created in the next tick.

    You can apply actions to a newly created instance, right after a "Create" action, but you can't do picking of that instance before the next event.

    But the 'on start of layout' does not execute in the next tick. This makes the pick events beeing skipped.

    There is a simple trick to know if your 'on start of layout' has a problem with picking. And that happens a lot if you are not carefull. Change the 'on start of layout' to 'on mouse clicked'. If it works now, you need to bring the events out of the 'on start of layout'.

    That makes sense, thanks to everyone !.

  • The newly created objects are not pickable outside of sub-events till the next toplevel event.

    More info here:

  • The newly created objects are not pickable outside of sub-events till the next toplevel event.

    More info here:

    Ok thanks for the info, I think it is quite clear.

  • > The newly created objects are not pickable outside of sub-events till the next toplevel event.

    > More info here:

    >

    >

    Ok thanks for the info, I think it is quite clear.

    in order for the var condition to be working on your sprite i suggest add it on the sprite as a instance variable instead of a global variable. the way you made the events... you created a sprite object and thats it.

    then added 2 conditions that triggers the actions for positioning the sprite that is referring to all the sprite objects existing on the map not to 1 or the new just created.

    you need to identify the sprite you just created in order to move that one only.

    for example i do a "type" instance variable usually then when a sprite is created i add the type number to the count of sprites existing that way i can say if C= sprite.type=5 set - A= sprite.setx to N

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
104 128,205
fenis99's avatar
fenis99
Unread hot topic
99 10,155
karshinkoff's avatar
karshinkoff
Unread hot topic
112 12,479
Pode's avatar
Pode