I have a player object in the scene, with a GUITexture on it.I am trying to access the texture to change it, but I am getting the error:
BCE0004: Ambiguous reference ‘guiText’: PlayerController.guiText, UnityEngine.Component.guiText.
(PlayerController is the name of the script. It’s attached to the same object.)
Here’s the relevant script:
var guiText : GUITexture;
function Awake(){
position = 1;
guiText = GetComponent(GUITexture);
}
function Update () {
if (HUD.isPaused == false && canMove == true)
{
if (Input.GetButtonDown ("right"))
{
position = 1;
guiText.texture = textures[0];
etc...
the ambiguous reference is throw by the last line in the above code… Someone please explain this to me! thanks in advance…