i have a raycast hitting an enemy, when i hit the enemy i want a cross to appear like in call of duty or crysis, my probelm is that i have it displaying but it never goes away. how can i get it so that only when i hit the eney to show then if im not dissapear basically what im wanting is a hitmark exaclty like cod or crysis. thanks.
if (hit.collider.gameObject.tag == "Enemy")
{
displayHits = true;
}
else
{
displayHits = false;
}
public void OnGUI()
{
if (displayHits)
{
GUI.DrawTexture(new Rect(Screen.width / 2 - hitMark.width / 2, Screen.height/2- hitMark.height/2,hitMark.width, hitMark.height), hitMark);
}