• 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!

(Solved)Can you Instance_Create "Self?"

T

TriiiKill

Guest
Is there a code to create "self?"

for ex:
instance_create(x,y,self)

But I know that doesn't work, (error message). I'd rather not replace "self" with the name of an object, because I want to copy-paste this code to many different objects that duplicate themselves.

Let me know if it's possible, or what the code looks like. Thanks.
 
W

whale_cancer

Guest
Code:
instance_create(x,y,object_index)
object_index is...
This read only variable returns the index of the object that the instance has been created from. This is not the same as the object name, which is a string and can be found using object_get_name, as this function returns the index number, which is a unique number that GameMaker: Studio assigns to every object at the time of creation.
 
Top