• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Placing a script in parent object and use default sprites for child object?

Artie_Kyle

Member
Hey everyone,

Sorry for the confusing title, but basically I have a parent object and I'm placing a script in it that uses the sprite you have, so I want all the children to use the script but maintain their default sprites, so what exactly do I call in the parent object?

Is there like a default sprite setting I can assign for sprite_index?

Thanks!
 

Relic

Member
Yes, or you could not pass anything at all and in the script just use sprite_index. When the script runs, the scope is still on the calling instance and has access to all the variables, built in or not, of the calling instance.
 
Top