camera vector

how can i get the camera vector where is looking at in world position?
example if the camera is looking at +X i would like to get the vector3 (1,0,0)
thanks.

http://docs.unity3d.com/ScriptReference/Transform.html http://docs.unity3d.com/ScriptReference/Transform-forward.html

1 Answer

1

You need to get the Gameobject and then use

CameraVector = CameraGO.transform.forward;

(untested)

this will return the Vector3

transform.forward