- Home /
How can I identify a non-uniform scaled mesh, and fix it?
Uhhmm sorry Unity Heads I forgot to include the code for rotation ;) ,now I have and also a link to a UnityProject with a Problem Demo(see below)!
I have problems with a rotation on an imported mesh in a deep child structure.
A parented mesh should rotate with its parent but keeps facing up the Y Axis, I do this by having a simple script like...
function Update(){
//
transform.up = Vector3.up;
}
...and the code for the rotation is:
function Update(){
//
if(Input.GetMouseButtonDown(0))
transform.Rotate(0,0,90);
}
...this is no problem the rotation works like it should, but the position of the child is changing in an unwanted manner(not holding parents position).If I remove the script the position is where it should.
So I swapped myMesh with a standard Unity Cylinder, and the position problem disapears. My first thought was it is a non-uniform scaled mesh, and I exported it again.
Same problem with the position, then I checked(more than once)...
- Pivotpoints
- MeshScale
- Different exportformat(.obj, .fbx)
- put mesh in an emty GameObject
...with no effect.
If it is a non-uniform scaled mesh how can I 100% identify it, or what could it else be?
I build a little project to demonstrate the problem.
The project has two Scenes one with MyMesh where the problem occurs(MyProblemScene), and a Scene with a UnityMesh(MyWorkingScene).The rotation is done via Left Mouse Button.
Download the project: Fast Files - Free File Hosting
File Name: RotationTest.rar
File Description: Unity3 3ProblemDemo
File Size: 157.77 KB
Answer by GameGuy · Apr 08, 2011 at 04:55 PM
The Autodesk FBX Converter fixed my rotation problem, I had never bevore such problems with my imported meshes in Unity. In this forumpost I found the answer.
For all with the same problem check out the FBX converter :
http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=10775855
Your answer
Follow this Question
Related Questions
Where to find original unity Parent/Child script? 2 Answers
Make a simple tree 1 Answer
Behave like another object is parent? 2 Answers
Camera follow ball along cylinder 1 Answer