Have a question regarding scaling

Hey guys I’m having a scaling problem could someone help me out here?
I am making some children objects on the launchpad and for some reason scaling is acting whack. When I create the cube separately ie not as a child reset its transform and then make it a child when I attempt rotation I get this happening:


When I create the cube as a child I get this:

Good question…

In the top image, I see the scale tool is selected, but you say you’re trying to rotate the transform…

How are you rotating? In the scene view? In the Inspector/Transform?

When I switch to the rotate tool with a cube, it’s doing only what I expect. I don’t see a way to lock any of the axis, but…

I find I’m unable to re-create any similar behavior… but it looks like it’s trying to rotate with one axis locked, or something? Sorry, I wish I could be more help…

1 Like

Thanks for looking into it for me dude. I figured it out. Complete noob mistake. I forgot to reset the transforms on the launchpad when I first created it.

Nope that wasn’t it at all. Even with a new launchpad and environment objects any new object is doing the same. Might have to do a redo and leave this to figure out another day.

Hi Adam,

I’ve read your question several times and am struggling to understand what you are asking.

Are you talking about the box collider being different to the mesh that is being rendered? Or are you referring to the values in the Transform, e.g. the 0.12204 scale value etc?

Yeah sorry I’m completely new to this s I’m not sure how to explain. This is probably the easiest way to see the problem.
This is with all objects separate:


and this happens as soon as I make the objects on the launchpad children of it.

Hey,

Yeah sorry I’m completely new to this s I’m not sure how to explain.

That’s no problem at all, I just wanted to be certain as to what I was responding to if I dove in on this one :slight_smile:

Would you be able to share the project files with me so that I can take a look first hand?

The forum will allow uploads of up to 10MB, if your project files (zipped) are larger than that you would need to use a service such as Google Drive or Dropbox, and then share the URL.

If i create a new object as a child of the launchpad this distortion happens:

It would seem that the same scale you are applying to the, now parent, cylinder is being applied to the sphere. If you check the Inspector, I’m going to guess that the recently added sphere has a significant scaling on the Y axis, as does your cylinder.

I’d like to see this first hand to have a play with if you are happy to share the project files.

In the mean time, instead of dragging all of these objects into the Cylinder GameObject, create an empty which doesn’t have any scaling at all, and then drag them all to be children of that and see if the same issue occurs, my feeling is that it wont.

That would be awesome thanks.
3_Dream_E_scape.zip (145.8 KB)

Taking a look now Adam…


Updated Tue Oct 16 2018 23:30

Ok, so I can reproduce your issue and as I suggested above, if you create an Empty GameObject in the Hierarchy, and then add all of the other GameObjects to that, the issue doesn’t occur.

Also, I’m guessing you added all of the other GameObjects in one go, as I did initially? I found that I could drag Cube into Cylinder and there was no issue. But Cube (1) and Cube (2) got displayed differently when they were moved in.

The issue with the cubes gets misshapen appears to be related to the rotation. If you set the rotation of Cube (1) to 0, 0, 0 and then child it to the Cylinder it is fine. If you then type in the values 45, 45, 45 for the rotation, it then distorts again.

This doesn’t occur when you use an empty GameObject. I have seen the issue with the rotation and the box collider separating from the mesh before, although I can’t recall the circumstance now, but not related to the cylinder.

Happy to keep fiddling for a while but my suggestion would be to simply create the Empty GameObject, position it at 0, 0, 0, leave the scale as 1, 1, 1 and then parent all of these GameObjects to it.


Updated Tue Oct 16 2018 23:49

A little bit more digging…

Apparently this is a fairly common issue and is caused by having a parent with a non-uniform scaling. In the case of your cylinder, it’s 5, 1, 5, thus non-uniform.

If you set your cylinder’s scale to 1, 1, 1, drag the objects in, they all look ok but of course then your cylinder GameObject is too small for what you are wanting to achieve. So, as per the above, your best course of action would be to use the Empty GameObject which can have a uniform scaling of 1, 1, 1 and then everything else is added as a child to that.

Perhaps name your empty GameObject LaunchPad or something relevant etc.

Hope this helps :slight_smile:


From the Unity Manual regarding Transforms;

Limitations with Non-Uniform Scaling

Non-uniform scaling is when the Scale in a Transform has different values for x, y, and z; for example (2, 4, 2). In contrast, uniform scaling has the same value for x, y, and z; for example (3, 3, 3). Non-uniform scaling can be useful in a few specific cases but it introduces a few oddities that don’t occur with uniform scaling:-

Certain components do not fully support non-uniform scaling. For example, some components have a circular or spherical element defined by a radius property, among them Sphere Collider, Capsule Collider, Light and Audio Source. In cases like this the circular shape will not become elliptical under non-uniform scaling as you would expect and will simply remain circular.

When a child object has a non-uniformly scaled parent and is rotated relative to that parent, it may appear skewed or “sheared”. There are components that support simple non-uniform scaling but don’t work correctly when skewed like this. For example, a skewed Box Collider will not match the shape of the rendered mesh accurately.

For performance reasons, a child object of a non-uniformly scaled parent will not have its scale automatically updated when it rotates. As a result, the child’s shape may appear to change abruptly when the scale eventually is updated, say if the child object is detached from the parent.

Muchas gracias. So awesome to see how ready people are to help each other out in this field.

1 Like

You’re very welcome :slight_smile: