GML [Solved]Check istance of multiple objects

A

achille911

Guest
Hello everybody!

I've made some test and research, but i cant find a way to make my homing missile object (Obj_Missile) to point to enemies the way i want.

Lets say i have this missile and i have 3 type of enemies (Obj_Enemy1, Obj_Enemy2, Obj_Enemy3).
I want to use instance_nearest, or a similar thing, to check the nearest instance of ALL the 3 objects, not just one at a time.

Is there a way to do so?

Thanks
 

Dmi7ry

Member
Create "Obj_Enemy" object and set up it as parent of Obj_Enemy1, Obj_Enemy and Obj_Enemy3.
Then use instance_nearest with Obj_Enemy.
 
A

achille911

Guest
Oh well, that worked perfectly, i'm pretty new so i have to learn how parents really work.

Thanks a lot!
 
Top