C
Clusta626
Guest
Hi all, thanks for your help in advance, I've looked across the forums and read the documentation on id and instances and cant seem to work out what is going wrong. It's possible I just don't understand the nature of instance Id's. Any help is greatly appreciated.
I'm using a position_meeting to cause instances to change on a mouse over and trying to get the instance with the mouse over it to grow slightly and register its id to a variable. There are multiple instances of the same object with the below code as a step event. All instances change scale when the mouse hits them(as desired) but the two global variables only change when the mouse is over the first instance of the object in the room. If the mouse is over any of the other instances the two global variables both stay at 0. I tried replacing the "id" fixed variable with "self" and "image_id" but this didn't work.
Thanks again in advance.
I'm using a position_meeting to cause instances to change on a mouse over and trying to get the instance with the mouse over it to grow slightly and register its id to a variable. There are multiple instances of the same object with the below code as a step event. All instances change scale when the mouse hits them(as desired) but the two global variables only change when the mouse is over the first instance of the object in the room. If the mouse is over any of the other instances the two global variables both stay at 0. I tried replacing the "id" fixed variable with "self" and "image_id" but this didn't work.
Code:
if position_meeting(mouse_x,mouse_y,id)
{
image_xscale = 1.1;
image_yscale = 1.1;
global.anchor_selected = id;
global.anchor_able = true;
} else
{
image_xscale = 1;
image_yscale = 1;
global.anchor_selected = 0;
global.anchor_able = false;
}