BASIC
If you want a object to simply move towards a point or another object heres the code:
move_towards_point(ball.x,ball.y,5)
ball is the point you want to move towards, 5 stands for the speed.
_____________________________________________________________________________________
If you want a object to move towards a point avoiding SOLID heres the code:
action_potential_step(ball.x,ball.y,5,0)
Ball stands for the point. 5 stands for the speed. 0 means to avoid solid objects.
If you want a object to move towards a point avoiding ALL INSTANCES heres the code:
action_potential_step(ball.x,ball.y,5,1)
Ball stands for the point. 5 stands for the speed. 1 means to avoid all objects.
_____________________________________________________________________________________
A BIT MORE ADVANCED
If you want a object to move towards the nearest of multiples of the same object without avoiding other objects heres the code:
move_towards_point(instance_nearest(x,y,ball).x,instance_nearest(x,y,ball).y,5)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move.
_____________________________________________________________________________________
If you want a object to move towards the nearest of multiples of the same object avoiding SOLID objects heres the code:
action_potential_step(move_towards_point(instance_nearest(x,y,ball).x,move_towards_point(instance_nearest(x,y,ball).y,5,0)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move. action_potential_step tells it to avoid the objects. 0 stands for avoiding solid objects.
If you want a object to move towards the nearest of multiples of the same object avoiding ALL INSTANCES heres the code:
action_potential_step(move_towards_point(instance_nearest(x,y,ball).x,move_towards_point(instance_nearest(x,y,ball).y,5,1)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move. action_potential_step tells it to avoid the objects. 1 stands for avoiding all instances.
I hope this helped, any other questions please pm me.
If you want a object to simply move towards a point or another object heres the code:
move_towards_point(ball.x,ball.y,5)
ball is the point you want to move towards, 5 stands for the speed.
_____________________________________________________________________________________
If you want a object to move towards a point avoiding SOLID heres the code:
action_potential_step(ball.x,ball.y,5,0)
Ball stands for the point. 5 stands for the speed. 0 means to avoid solid objects.
If you want a object to move towards a point avoiding ALL INSTANCES heres the code:
action_potential_step(ball.x,ball.y,5,1)
Ball stands for the point. 5 stands for the speed. 1 means to avoid all objects.
_____________________________________________________________________________________
A BIT MORE ADVANCED
If you want a object to move towards the nearest of multiples of the same object without avoiding other objects heres the code:
move_towards_point(instance_nearest(x,y,ball).x,instance_nearest(x,y,ball).y,5)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move.
_____________________________________________________________________________________
If you want a object to move towards the nearest of multiples of the same object avoiding SOLID objects heres the code:
action_potential_step(move_towards_point(instance_nearest(x,y,ball).x,move_towards_point(instance_nearest(x,y,ball).y,5,0)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move. action_potential_step tells it to avoid the objects. 0 stands for avoiding solid objects.
If you want a object to move towards the nearest of multiples of the same object avoiding ALL INSTANCES heres the code:
action_potential_step(move_towards_point(instance_nearest(x,y,ball).x,move_towards_point(instance_nearest(x,y,ball).y,5,1)
instance_nearest tells it to move towards the closest of that object. ball stands for the point to move towards. 5 stands for the speed to move. action_potential_step tells it to avoid the objects. 1 stands for avoiding all instances.
I hope this helped, any other questions please pm me.