# How do you rotate RigidBody2D along a given access using velocity and not transform?

I am trying to rotate my player along the centre of the world in Unity3D. All the tutorials and references I have looked through till now have left me to this working code:

void MoveAlongCurve(bool moveClockwise) {
if (!moveClockwise)
timeCounter += moveSpeed*Time.fixedDeltaTime;
else
timeCounter -= moveSpeed*Time.fixedDeltaTime;

float x = Mathf.Cos (timeCounter);
float y = Mathf.Sin (timeCounter);

transform.position = new Vector3 (distFromCentre*x, distFromCentre*y,0);
}


Also this seems to work fine as well:

transform.RotateAround (Vector3.zero,new Vector3(0,0,1),speed);


Now my question is how do i move my player using velocity? I was forced to keep my body as 'kinematic rigidbody2D' however I want my player to be a 'dynamic rigidbody2D'.

My reason for this is several: 1. Movement via velocity makes it independent of the timeCounter. 2. Dynamic Bodies enable collisionDetection. Hence it is basically a requirement for my game.

Thank you so much for taking the time to read this! Any suggestions or nudges in the right direction would be greatly appreciated and if you find anything wrong in my code or approach please comment!

• See Rigidbody.MoveRotation's Documentation ( docs.unity3d.com/ScriptReference/Rigidbody.MoveRotation.html ). Commented Mar 21, 2018 at 21:13
• This method rotates the 2D body along the local z axis. I would like to rotate the body along an axis in the world space. Is this possible using this function? Commented Mar 21, 2018 at 22:53

Vector2 VelocityToReach(Vector2 destination) {