• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Thousands of Instances are created

Hello Hello, I need help, for some reason too many instances are created, this is my structure

if room = rm_home and global.duelo = true
instance_create (64,80, obj_mouse2)

Now I explain what is happening there: if I select the mode for 2 players, I check if it is in the home room and if the value of the duel is equal to true (the value of the duel = true is set if you put the mode of 2 players ) and creates the mouse2 instance which is controlled by player 2, but thousands of mouse2s are created (I don't know if I explain it well but it helps)

PS: if I had a spelling error, it is because I use the google translator (I speak Spanish)


Firehammer Games
You need to tell us what even this code is in. Note that if it is in the Step event, that is the wrong place, because code in the step event runs every single frame. You would need to put it in a Create event instead so that it only happens one time.


If it needs to be in the step event then just add an if statement before the creation:
if (instance_exists(obj_mouse2) == false) instance_create (64,80, obj_mouse2);