I’m trying to make a boss arena where the player orbits in a circle around the boss enemy.
I’m trying to use the movement component since I’d like braking, friction, gravity, etc. Currently the player is also moving up and down the screen, so the movement mode is flying. Braking of 2000, fly speed of 600.
The player also rotates to face the boss at all times using Controller Rotation Yaw (image of code has been attached).
I’ve attached the current orbit code as an image, but I’m facing a slight issue. Whenever I move the player character slowly drifts backwards over time, which brings them out of the alignment of the circle. I’m not sure how to stop this, I’ve tried normalizing and I’ve tried adjusting movement values.
I’m mostly sure it’s to do with the movement component since it’s super noticeable when the player slows down, but I’m also not sure. It could just be my math. I don’t want to use set player location since although I can get that working I noticed if the player walks into any obstacles they do get stuck for a second, which is really bad considering this is a boss fight.
Does anyone have any solution or suggestion? Or if set actor location is the better option, a way to handle the getting stuck on objects?
Thanks
Edit:
I’ve marginally solved it with this by “nudging” the player back on course as they finish moving. I’m going to keep this post up however incase someone has a cleaner solution!


