Exception: not implemented

Ive seen this question pop up but i think this a bit different, i am trying to set the width of a GUITexture’s texture. Unfortunately i get the error stated in the title. Ive looked at different things but i dont know how i would work it into this code. Any Advice? Heres my code.

using UnityEngine;
using System.Collections;

public class FPSPlayer : MonoBehaviour {

public int health = 100;
public GameObject healthBar;

void Start () {
	healthBar = GameObject.Find("Hud Health Bar");
}

void Update () {
	GUITexture hTexture = healthBar.GetComponent<GUITexture>();
	hTexture.texture.width = health;
}
}

Any Help Is Appreciated

Texture.width is read only since the texture size is fix. You can’t change the width / height of a texture on-the-fly. What would you even expect to happen with the pixels you’ve just cut off ? :wink:

You have to use GUITexture.pixelInset to change the appearance but not the texture itself.