- Home /
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
@getyour411 sorry i wrote the code here wrong .. it is Start() but still will make my texture code not working, when i comment the code : transform.localScale = new Vector3 (5, 5); then the code works fine
Answer by hexagonius · Dec 14, 2016 at 07:51 PM
well, it's a Vector3, not 2. The constructor needs a third parameter (5,5,5)
Your answer

Follow this Question
Related Questions
Warning: "Setting scale failed, ignoring request." ? 1 Answer
Dynamic Texture Tiling 1 Answer
Resize object in runtime 1 Answer
Transform position from end of gameObject 0 Answers
Texture Size doesn't match collider size 0 Answers