How should I go about making a flying enemy?

I want to make an enemy that flies towards the player in a boss battle, however I’m not sure what I should use.
At first I tried subtracting the position of the enemy from the position of the players head and for each axis it would calculate if it was positive, negative, or less than 0.5 away. If it was positive it would move 0.25 negative, if it was negative it would move 0.25 positive, and if it was less than 0.5 away it wouldn’t move on that axis. However the movement was very choppy and it would randomly stop moving (probably due to the script being overloaded as this was looping.)
I also tried using Model:MoveTo() to try to achieve this but it just automatically teleported over the players head and I want the enemy to move closer to the player, not just immediately reach the player. I’m not asking for a script or for the entire system, I just need pointers for what I can use to get this to work.
Thank you for your help.

Literal quick search: Part 2 Electric Boogaloo

Sorry about that. It didn’t show up on the similar topics.

I literally just typed “Flying Enemy” in the search bar, strange :thinking:

But yeah you could just set the Y’s MaxForce property of that to a high number in a BodyVelocity object

2 Likes

Thank you for the help! It works really well!

1 Like