Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
DannySilver's avatar
DannySilver
Honored Guest
12 years ago

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
No RepliesBe the first to reply