# left and right player movements restricted to a circle

i’m build a boss fight level where there is a cirlce platform
this is what work:
if i press up arrow the player go torwards the boss
if i press down arrow the player go in the opposite site (as you can see in the image)

how can i move the player (left and right arrow ) with mathematical circle equation, to move the player around the boss??

I think you have the right idea, with `XZradius`. One trick to programming is to set up your personal variables that describe what you want. Change them based on how you’re thinking of the problem. Then, “apply” them to the object.

Try:

``````float playerAngle; // 0 to 360. Angle, from center, of player
``````

Left/right arrow keys add and subtract from the player angle. Very easy, it’s just a number.

Then, don’t use translate or rotateAround, or anything that moves the player form where it was. You know the angle from the center and the distance, so just put the player there. This is a little tricky,

``````// how far the player is. This is straight North, which is 0 degrees: