Target specific instance

How do I target a specific instance? For example, if GlobalVariable(Keys) == 1 then destroy nearest/first instance of object Door. Is this even possible?

If you know wich instance you want to target, it’s easy:
-Add an object variable (e.g. “ID”) to the desired instance and set a non-zero value (e.g. 1).
-Then add the condition Variable "ID" of Object is = 1
So Game Develop will know you want to target that instance :wink:
(The ID variable should be different than zero because if you don’t set the ID variable in others instances, GD will set ID = 0 for all of them)

If you want to know the nearest object, check this :slight_smile:
[url]Find object nearest to a point]
or this:
[url]Testing for nearest object - #10 by Lizard-13]