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

Legacy GM When this happens, Do this for all of the Instances of this Object

H

Heat4Life

Guest
So actually, I am Curious about something and I might need to learn It for my Future Video Games... What If like for example: When this happens, Do this for ALL of the Instances of THIS OBJECT. How to do this? Thanks!

All Answers would be greatly appreciated! :D
 
L

Lars Karlsson

Guest
I like to use user events for these kind of things.
Put all your code inside the event_user(0).

Code:
if (something happens)
{
    with(obj_object)    // This will go through all the instances of the obj_object.
    {
        event_user(0);
    }
}
 
H

Heat4Life

Guest
Oh, I thought that the with only works for different instances of an another object... Thanks guys! :D
 
Top