system
1
So what's wrong with it? The ground will instantiate, but not scale.
var ground : GameObject;
var roadLength : int = 15;
var numberOfRoads : int = 10;
function Start (){
Instantiate (ground, Vector3(-10,0,-10), transform.rotation);
transform.localScale.x = numberOfRoads * (roadLength+35)+200;
transform.localScale.y = 100;
}
DaveA
2
You are scaling 'this' object, not the one you instantiated. Try
var newObj = Instantiate (ground, Vector3(-10,0,-10), transform.rotation);
newObj.transform.localScale.x = numberOfRoads * (roadLength+35)+200;
newObj.transform.localScale.y = 100;
Your code should be something like:
var clone : GameObject;
clone = Instantiate (ground, Vector3(-10,0,-10), transform.rotation);
clone.transform.localScale.x = numberOfRoads * (roadLength+35)+200;
clone.transform.localScale.y = 100;