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

take object instances

Heavybrush

Member
how to take the instance of the current object created?
how to take the previous?
how to take all the instance of a specific object?
and how to take width and height of the sum of all the instances of an object?
 

RangerX

Member
If you want to access anything easily inside and instance you're creating, catch it in a variable:
MyInstance = instance_create(x,y,object);

Then let's say you want to change its direction:
MyInstance.direction = 30;

To address something to all the instance of a particular object, you might want to use a "with":

with (objec index)
{
Do stuff;
}


Not sure I understand your last question. What are you trying to achieve?
 

Heavybrush

Member
I'm trying to have an empty room, and create a procedural room by:
create a start module and after this create all the other random modules one by one
but I need to know what they are, because in the meanwhile they are creating the current object instance must match the previous in base of the sprite
 
Last edited:
Top