- Home /
The question is answered, right answer was accepted
Scale script don´t work
Hi i´m trying to make a sphere which is scaling. But my script don´t work. Here is it:
var scaleX : float = 2;
var scaleY : float = 2;
var scaleZ : float = 2;
function Start () {
transform.localScale = Vector3(scaleX,scaleY,scaleZ);
}
Thanks for help. it´s still on deufalt scale in Inspector (1,1,1) how to change it via script ?
Answer by robertbu · Aug 07, 2014 at 04:52 PM
Since the values are public, after you attach the script, you need to either 1) change the values in the Inspector (before running the app), or 2) make the values in the script private:
private var scaleX : float = 2.0;
Follow this Question
Related Questions
Help finding the right scale for an icon inside a backgorund sprite 1 Answer
Why does this not scale smoothly? Any Ideas? Transform.localscale 2 Answers
How do you Scale Game Objects with the Screen? 0 Answers
Problems with scale and rotation 2 Answers
Scale of GameObject is reset when enable an attached Animator component 1 Answer