In Unity, I need to move a CharacterController from v2 to v3. I have the following information: the centre point of the circle (v1); the current character position on the outside of the circle (v2); the angle (a). How do I calculate the move vector for the CharacterController so it moves from v2 to v3?
v3 = Quaternion.Euler(0, a, 0) * (v2 - v1) + v1
motion = v3 - v2
Explanations:
v2 - v1
: Vector of v2 with v1 as the originQuaternion.Euler(0, a, 0) *
: Rotate the above vector counter-clockwise by a
degree around the y-axis. If this is about 2D, you need to rotate around the z-axis+ v1
: Get the v3 position in world spacev3 - v2
: The move vector is from v2 to v3