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