0
\$\begingroup\$

I am making a game in Unity using c# where the player object is rotating around the world origin. I am using transform.RotateAround to rotate around the center and I want the player to be able to change to a bigger circle (change lane) like this:enter image description here

The player is represented by the black dot in the picture. How do I make it so that the player at any time can change lane without changing position. So basically if you imagine a straight line starting at world origin and continuing through the player, I would want the player to move to the coordinates where that line crosses the lane 2 circle. How do I do this?

The game is 3D and the circle is on the x and z axis.

\$\endgroup\$
  • \$\begingroup\$ Watch this tutorial, It might help. youtube.com/watch?v=Ho1mESRLlhk If you still need help then I will try to send you the complete script. \$\endgroup\$ – Swati Jan 13 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.