Hello guys,
In my game I have objects (upgradable "turrets"), if I click on those it opens a new tab that lets me upgrade the clicked one. To do that I wrote this code:
pTurret - Left Pressed:
oTab - Left Pressed:
But doing so, it keeps the id of the first turret created.
So I tried to fix that, moving the id_get in the Step Event:
pTurret - Step Event
This works better, but now I have another problem: if I click on the tab it's like I click on the instances under the window too.
I don't want to deactivate instances in that region because it generates errors using those ids.
I have no idea how to fix this, maybe using a variable. But I tried in that way and it didn't work, could you guys help me? Thanks!
In my game I have objects (upgradable "turrets"), if I click on those it opens a new tab that lets me upgrade the clicked one. To do that I wrote this code:
pTurret - Left Pressed:
GML:
_id = instance_position(mouse_x, mouse_y, pTurret);
instance_create_layer(1056, 576, "Instances", oTab);
oTab - Left Pressed:
GML:
with(pTurret._id) {
// Do stuff
}
But doing so, it keeps the id of the first turret created.
So I tried to fix that, moving the id_get in the Step Event:
pTurret - Step Event
GML:
if(mouse_check_button(mb_left)) {
_id = instance_position(mouse_x, mouse_y, pTurret);
}
I don't want to deactivate instances in that region because it generates errors using those ids.
I have no idea how to fix this, maybe using a variable. But I tried in that way and it didn't work, could you guys help me? Thanks!