check an instance?

N

Nuno

Guest
Hi guys,

I'm having trouble checking if an instance is the nearest to my mouse.

What i've done was simply putting in obj_A's step folder this:



//defining variable nearest_A
nearest_A = instance_nearest(mouse_x,mouse_y,obj_A)

//doing 'something' when this instance of obj_A is the closest to my mouse cursor
if (instance_id == nearest_A)
{
something
}.



the problem is that 'something' doesn't happen and I'm sure it must be because the 'if' statement does not trigger. What am i doing wrong here?

Thanks
 
Actually, it's just id. self is a depreciated keyword that you really never need to use if you're doing everything correctly.
 
Top