Find angle from velocity

I want to set angle based on gameobject velocity for 2d game. At present in game, object moves in correct direction but with wrong angle. If I can able to set angle from its velocity then my problem is solved but I can’t able to find solution for that.

I already used google for this purpose but didn’t find any useful content. Please give me some suggestion in this.

EDIT : I just want to send angle angle of my copter in direction it is going. That was my motto behind this question.

store the position the object was in, in the previous frame. in the next frame, move the object, get its position, find the delta between this position and the last position. Then you can use a little trigonometry to calculate the angle.

@imaginaryhuman_1 , Thanks for you reply.
I got correct answer from other forum member.

  Vector2 dir = rigidbody.velocity;
  float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
  transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
1 Like