Changing local scale effect texture codes

when i change scale using a code it will effect the code i used to change a texture on a game object
any tip?

    public Texture pictureTest;
            public GameObject theQuad;
    	public Renderer rend;
void Start ()
    	{
    		rend = theQuad.GetComponent <Renderer> ();
    		rend.material.mainTexture = pictureTest;
            transform.localScale = new Vector3 (5, 5);
    	}

start() should be Start(), not clear if that will fix your issue as your code will actually run

–

1 Answer

1

well, it’s a Vector3, not 2. The constructor needs a third parameter (5,5,5)

worked ! thanks man :)

–

You did change other references to the variable "Gunfire" to "fire" right? e.g. changing "Gunfire = GetComponent()" to "fire = GetComponent();".

–