Hi i’m trying to make my player move right or left by rotating around a center point but I cant figure out how to code it. please help
.
1 Answer
1One possible way (among others) to do this : embed the player in an invisible circular Game Object. On your drawing the empty parent GO would be the circle (you can render it to help you see the trajectory of your player, and disable it at runtime). Your player would be a child of this GO, its local position being something like 0,-10, 0. All you would have to do is rotate the parent GO. Quite simple.
Yep, this is the easiest and more important the most stable solution. Any relative rotation around a point can drift over time.
– Bunny83
https://docs.unity3d.com/ScriptReference/Transform.RotateAround.html It will say it's obsolete but it still works.
– Cherno