make a child always have its own scale?

Is there some way to code for a child object to retain its own original scale no matter what the scale/skew of the parent is? I don’t know how to go about getting a specific scale for the object to refer to when parented to diffent objects with various scales.


I typically would recommend, if you do not have too many children to handle, that you write a simple update script that just follows the parent plus a designated offset so that it ignores rotation and scale altogether, instead of parenting inside the hierarchy. Yes, it adds more updates, but in the end it’s just as easy as setting the localScale to the same every update as well.

You can use this function whereever you are scaling the parent, it goes through the children and unparents them and then reparents them after scaling.

    private void ChangeParentScale(Transform parent,Vector3 scale)
		List<Transform> children= new List<Transform>();
		foreach(Transform child in parent) {
		    child.parent = null;
		parent.localScale = scale;
		foreach(Transform child in children) child.parent = parent;	

I found that just saying

transform.localScale = transform.localScale;

in Update() worked like a charm. I guess it just needed reminding haha.

It looks crazy (in Update()):
transform.localScale = transform.localScale;
but it really works!!!

Omg transform.localScale = transform.localScale; in Update ()
Worked perfectly. THANK YOU!

Looks messy but worked for me

transform.localScale = new Vector3 (1/transform.parent.transform.localScale.x, 1/transform.parent.transform.localScale.y, 1/transform.parent.transform.localScale.z);

its dividing your desired scale(1) by your parents scale

if (Size != Old_Size && SphereColider != null)
SphereColider.radius *= Old_Size / Size;
transform.localScale = new Vector3(Size, Size, Size);
Old_Size = Size;

important part is “*= Old_Size / Size;”
multiply that by child scale and it will keep consistent size