This is probably a very simple problem. I want to know how (in code) to store an instance's ID for use as a variable.
Currently I have it so on a "Left (mouse) released" event, the object in question does this:
global.object_selected = self.instance_id
In the Step, it then runs an if query to determine if the global ID is the local ID, and then to change the sprite(/colour) to show that the player can use the clicked item.
if global.object_selected == self.instance_id
{
//do stuff
sprite_index = sprite2
}
else if global.object_selected != self.instance_id
{
sprite_index = sprite1
}But it isn't working and I must have done something very wrong. I want to be able to store the clicked instance ID in a global variable to allow the player to manipulate the individual instance they have just clicked.
Any help, greatly appreciated.











