• 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 Multiple instances with same ID?

Dr_Nomz

Member
I'd like to set up a spray of shotgun pellets with the same ID so that I can better control their behavior when they all hit something at once, so for example they won't all be destroyed upon impact with something else.

Is this possible or will all of them having the same ID cause issues?
 

Mr Magnus

Viking King
Instance id's are unique. You can not have two instances that have the same id, especially considering id's are read only and automatically assigned by game maker.

They however all share an object ID if they are all instances of the same object. you can use that with for instance a with(object) loop.
 

BlueBot5000

Member
Each ID Is It's Own Instance Even When An Object Creates Them IDs Are Also Have The Purpose So That You Can Do This In The Creation Code
Code:
if (Certain ID Do Something Probably Something About X And Y Postions)
{
    Activate Certain Code Maybe Play An Animation
}
 
Top