• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HELP ON LOCK ON MISSILES!!!

A

awsome129

Guest
I have been trying for a good amount of time to make lock-on missiles for a game i have been working on. I cant seem to figure it out though. Can some1 please help me. I want to make missiles that when fired will lock onto the nearest enemy and go towards them. HELPS ME PLEASE!!!
 

Kyon

Member
Something with instance_nearest() should work i think.
Like, in step event of the bullet something like:
Code:
target=instance_nearest(x,y,obj_enemy);
move_towards_point(target.x,target.y,4);
 
A

awsome129

Guest
wow. i thought i tried that but that worked. Thank you so much man.
 
Top