Forum Discussion
DannySilver
12 years agoHonored Guest
Unity / Crosshair
UNITY / CROSSHAIR
Hello my name is Daniel,
I´m from the wild South-West Germany
At first - sorry for my bad english - i work on it!
My question:
Can you tell me, how in can integrate a Crosshair in Unity
I tried it - but it didn´t work...
What i tried was:
I putted an extra script to the OVRPlayerController Game Object that contains the
scripts like "Character Controller, OVRGamepead Controller, OVR Layer Controller, OVRMian menue"
I putted simply below this list my new crosshair script that contains:
****************************************************************************************************************************
var crossTex : Texture2D;
var size : float = 32;
var crossColor : Color32;
//CROSSHAIR
function OnGUI()
{
GUI.color = crossColor;
GUI.DrawTexture(Rect(Screen.width/2 - size/2, Screen.height/2 - size/2, size,size), crossTex);
}
//CROSSHAIR
****************************************************************************************************************************
Bit it didn´t work! Can you tell me why? Can you tell my an other way to do this...
Greetings
Daniel
Hello my name is Daniel,
I´m from the wild South-West Germany
At first - sorry for my bad english - i work on it!
My question:
Can you tell me, how in can integrate a Crosshair in Unity
I tried it - but it didn´t work...
What i tried was:
I putted an extra script to the OVRPlayerController Game Object that contains the
scripts like "Character Controller, OVRGamepead Controller, OVR Layer Controller, OVRMian menue"
I putted simply below this list my new crosshair script that contains:
****************************************************************************************************************************
var crossTex : Texture2D;
var size : float = 32;
var crossColor : Color32;
//CROSSHAIR
function OnGUI()
{
GUI.color = crossColor;
GUI.DrawTexture(Rect(Screen.width/2 - size/2, Screen.height/2 - size/2, size,size), crossTex);
}
//CROSSHAIR
****************************************************************************************************************************
Bit it didn´t work! Can you tell me why? Can you tell my an other way to do this...
Greetings
Daniel
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 8 months ago
- 11 months ago
- 2 months ago