Crosshair not displayed on Rift
Hi there,
i am pretty new to Unity and the rift. I would like to set up a crosshair so I used the following code, and added the script
to the OVRPlayerController:
Rect crosshairRect;
Texture crosshairTexture;
float crosshairSize;
// Use this for initialization
void Start () {
crosshairTexture=Resources.Load("Textures/Fadenkreuz2") as Texture;
crosshairSize = Screen.width * 0.1f;
crosshairRect = new Rect (Screen.width/2-crosshairSize/2, Screen.height/2-crosshairSize/2,
crosshairSize,crosshairSize);
}
void OnGUI()
{
GUI.DrawTexture (crosshairRect, crosshairTexture);
Debug.Log ("Building Crosshai");
}
The crosshair is displayed when I use a "normal" player camera.
But it is not displayed if I add the script to the OVRPlayerController.Any suggestions?
Thanks a lot!
Adrian
i am pretty new to Unity and the rift. I would like to set up a crosshair so I used the following code, and added the script
to the OVRPlayerController:
Rect crosshairRect;
Texture crosshairTexture;
float crosshairSize;
// Use this for initialization
void Start () {
crosshairTexture=Resources.Load("Textures/Fadenkreuz2") as Texture;
crosshairSize = Screen.width * 0.1f;
crosshairRect = new Rect (Screen.width/2-crosshairSize/2, Screen.height/2-crosshairSize/2,
crosshairSize,crosshairSize);
}
void OnGUI()
{
GUI.DrawTexture (crosshairRect, crosshairTexture);
Debug.Log ("Building Crosshai");
}
The crosshair is displayed when I use a "normal" player camera.
But it is not displayed if I add the script to the OVRPlayerController.Any suggestions?
Thanks a lot!
Adrian
