Velocity to Angle

Is it possible to convert velocity to an angle of the vector3?

The thing is, I have a spaceship controlled with a real space physics. So adding thrust changes it’s direction and velocity accordingly. Spaceship can rotate independently on the direction it travels. I would like to have an object that would always point to the direction spaceship is moving to, no matter on spaceship’s rotation.

Player.rigidbody.velocity gives me the x,y,z values i was thinking to convert to an angle and then adjust the pointer to it. Tried to simply use Quaternion.identity(Player.rigidbody.velocity) but the Console just started calling me names.

???

I figured it out. The basis for what I need is done. Needs some improvement but now you can modify it to your needs.

Here’s the code:

var Player : Transform;
var Pointer : Transform;
var Detector : Transform;

function FixedUpdate () {

Pointer.transform.position =  Player.transform.position + (Player.rigidbody.velocity);
Detector.transform.position = Player.transform.position;
Detector.transform.LookAt (Pointer);

}

Now the Pointer points in the direction Player is moving to and the Detector is pointing towards Pointer so it can detect will Player collide with something if current movement direction remains.