like this, how can I make the white one only move the 90-degree path with the red one.
CodePudding user response:
I hope this is somewhat what you are searching for.
var radius = Vector3.Distance(redObject.transform.position, whiteObject.transform.position) ;
Vector3 direction = Quaternion.Euler(0, angle, 0) * Vector3.right;
var newPosition = redObject.transform.position direction * radius;
whiteObject.transform.position = newPosition;
Where you need to make your own direction and replace Vector.right with up or forward.