Unity Scaling an object from scripts

my script is this…When i scale the object it transform.position gets the same but in the world it shows at different position.

using UnityEngine;
using System.Collections;

public class size1 : MonoBehaviour {

// Update is called once per frame

void Update() {
	

	
		
	
	
	if(abc.Ball1>900 && abc.Ball1<=1000)
	{
		
		transform.localScale=new Vector3(1.5f,1.5f,1.5f);
	}
	else if(abc.Ball1>800 && abc.Ball1<=900)
	{		
		transform.localScale=new Vector3(1.3f,1.3f,1.3f);
	}
	else if(abc.Ball1>700 && abc.Ball1<=800)
	{		
		transform.localScale= new Vector3(1.1f,1.1f,1.1f);
	}
	else if(abc.Ball1>600 && abc.Ball1<=700)
	{		
		transform.localScale= new Vector3(.9f,.9f,.9f);
	}
	else if(abc.Ball1>500 && abc.Ball1<=600)
	{		
		transform.localScale=new Vector3(.7f,.7f,.7f);
	}
	else if(abc.Ball1>400 && abc.Ball1<=500)
	{		
		transform.localScale=new Vector3(.5f,.5f,.5f);
	}
	else if(abc.Ball1>300 && abc.Ball1<=400)
	{		
		transform.localScale=new Vector3(.4f,.4f,.4f);
	}
	else if(abc.Ball1>200 && abc.Ball1<=300)
	{		
		transform.localScale= new Vector3(.3f,.3f,.3f);
	}
	else if(abc.Ball1>150 && abc.Ball1<=200)
	{		
		transform.localScale= new Vector3(.2f,.2f,.2f);
	}
	else if(abc.Ball1>=50 && abc.Ball1<=150)
	{		
		transform.localScale=new Vector3(.1f,.1f,.1f);
	}
	else if(abc.Ball1>0 && abc.Ball1<50)
	{		
		transform.localScale= new Vector3(0f,0f,0f);
	}

}

}

The scaling happens always around the objects pivot point. The position is not affected when you change the scale. That sounds like you have set the pivot mode to “center” instead of pivot:

pivot mode image

If the mode is set to “center” it shows the “handle” at the objects center instead of its pivot

You are right, you can’t set the pivot point in Unity, but in the application you created the object. I’m not an artist so i can’t advise you how :wink: