- Home /
Question by
Jordan Miller 2 · Oct 06, 2010 at 08:08 PM ·
scaling
changing size of object, scaling
I have a child object under a parent. when the parent scales down, so does the child. is there a way to tell the child to always keep the same scale?
Comment
Best Answer
Answer by skovacs1 · Oct 06, 2010 at 08:20 PM
You can un-parent, scale and re-parent.
To do this in code would be
var children : Transform[];
for(var child : Transform in parent) {
child.parent = null;
children.push(child);
}
parent.localScale = something;
for(var child : Transform in children) child.parent = parent;
You could also do things with lossyScale like storing the lossyScale of each child, scaling the parent and then resetting the lossyScale of each child to the stored values.