• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

check an instance?



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)

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?

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