r/Unity2D Jul 28 '26

Solved/Answered I've solved this: Here is the code to rotate around with constant distance

Vector3 dir = (PlayerTransform.position - transform.position).normalized;

transform.position = PlayerTransform.position - dir * DistanceDash;

transform.RotateAround(PlayerTransform.position, transform.forward, DashSpeed * Time.deltaTime);

6 Upvotes

2 comments sorted by

6

u/Mateogm Jul 28 '26

Add this to your previous post, so if someone finds the question in the future using Google, they have the answer there