Wierd rotation when attaching planes.

Hey guys, wondering if anyone can help me with this problem.
First of all what I am trying to achieve is a skeletal system, with flat planes attached to each other to form different parts of a human body, then those planes can be animated in the inbuilt Unity Animation System.
Mostly so I can duplicate animations to make multiple characters and only have to change the textures to customize.

The problem I’m having is when I make a plane, all rotation at 0. When I attach one plane to another, so there’s 1 Parent and 1 Child. They rotate around the same axis ( a perfect circle ).
What I have noticed makes the rotation mess up, is when the a parent has more than one child, if it’s size or rotation is changed, it affects the other attached children rotation.

If someone could please tell me how to stop this weird rotation from happening even after I scale a parent, it would really help.

I hope the pictures will help.

474346--16666--$bug.png

Just to add, I’ve been messing around some more with it. What I have noticed is if the parent objects scale X and Z (according to my project) are not the same scale, then rotating the child gives it a weird orientation.

If anyone could please try this out on their Unity, so you can see what I’m trying to explain.

1.Create 3 cubes, or planes.
2.Parent them in order, so 1st cube is parent, 2nd cube is child of 1st, 3rd cube is child of 2nd.
3.Rotate the 2nd cube, normal rotation on the 3rd.

Now do the same thing, but before you parent the cubes, set the scale of the 1st cube along the X scale to any number.

Sometimes this happen to me too, also in 3ds max. Does any body know why?

I was just going to try it on a 3d modeller and export the plane to see if I have the same issue.

Is it possible in unity to write code that alters the positioning rotation of a game object and so forth and show the effects in real time within the editor ?

2D Animation in Toon Boom

That is exactly what I’m trying to replicate in unity by using the planes and the Animation Editor built in. But I cannot scale and stretch the planes because it messes up the orientation of rotation for the other planes.

Hope that helps anyone.

From Unity - Scripting API: Transform.lossyScale

If I was going to try to get around this, I would unparent all the objects. Then write a script and attach it to a child, telling it to move when the parent moves, and rotate when the parent rotates, but not scale when the parent scales. This should give parent-like behavior, without the skewed rotation.

Ah not a bad idea, ill try that out too.

Was thinking of making a tiling system a collection of 1 scale planes to make up any part of the body, and then using an empty gameobject to represent that body part.
Only issue I think is performance, but Im going try to work around that.

Your “problem” is just how hierarchical object coordinates work. If you scale the parent object, the world space of the child object is scaled too, so one unit in your scaled axis represents not anymore one unit in world space. Thats like having a 4:3 resolution streched on a 16:9 screen. A circle becomes an ellipse which means that rotations follow an ellipse also.

Instead of scaling your planes you better just create quads in the correct size by your own using the mesh class. This way you would not waste so many polygons too…

Ah dude, you hit the nail on the head. That is probably the best solution.

I’m guessing unity has the power for me to tweak the user interface for real time editing of those meshes while in the editor, easier to work with animations that way.
You know where I find any tutorials for tweaking the editor to build my own custom unity game tools built into unity ?