so i am trying to access the GUITexture component on an object in my scene. So this is what i did:
using UnityEngine;
using System.Collections;
public class FPSPlayer : MonoBehaviour {
public float health = 100.0f;
public GameObject healthBar;
void Start () {
healthBar = GameObject.Find("Hud Health Bar");
}
void Update () {
Texture texture1 = healthBar.GetComponent<GUITexture>;
}
}
And this is the error:
Cannot convert method group
GetComponent' to non-delegate type
UnityEngine.Texture’. Consider using parentheses to invoke the method