GMS 2 obj moves towards player then orbits it?

jb skaggs

Member
Hi, my question in GML:

I want to have an object orbit or swarm around the player object once it reaches it.

My hangup is after the collision occurs would I then just use lengthdir to create the orbit? Or is there a simpler way?

JB
 

Simon Gust

Member
I would use lengthdir.
Code:
dir += 5;

x = player.x + lengthdir_x(radius of the orbit, dir);
y = player.y + lengthdir_y(radius of the orbit, dir);
 
Top