• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

[Solved] With working In the create event ?

Alexx

Member
The Create Event only runs once when the object is created.

What are you trying to achieve?
It's possible you need your code in a different event.
 
The Create Event only runs once when the object is created.

What are you trying to achieve?
It's possible you need your code in a different event.
I find my mistake I just made a pre-state0 in the Step event using a switch loop and using an alarm to switch to state1.

And yep so you can't define define a variable who will never change in a object since you always use
var inst = instance_create_layer() // somewhere
with(inst) { number = ......... etc } //right after.



Or maybe there a way I don't see ?
It's not a big issue, it's just a load a tons of variable from a ds.list and don't want to repeat it even for a fraction of second. And I have to use an alarm because I use a global.varible to sync all my player in a team...
 

TheouAegis

Member
If the object you are trying to create an instance of has code in its Create Event which requires a variable (in this case, 'number') to be set, you cannot do that. In your code, with(inst) gets run after the Create Event of the new instance is run.
 
Top