- Home /
Issue with axis values when importing from 3ds max
I am using 3ds max to model a character which contains an animation frame where he is holding a gun in which it points straight ahead of him, like so:
The issue is when I import it into Unity, the gun does not look straight ahead when I load the animation, but rather, like this:
As you can see, this does not replicate how it looks in 3ds max, as well as that, the axis alignment is completely off, which leads to issues when using the LookAt() function.
If i give my character an empty game object, a distance of 20 units away on the zaxis, if i try point my gun at it using LookAt(), it aims straight at the ground.
Anyone know why this might be happening?
Answer by Cherno · Aug 14, 2015 at 10:55 AM
In Max, rotate the pivot so the green arrow points toward the top. Export again.
If you are using bones, then it's a little bit more tricky. You'd have to apply a vector3 in LateUpdate to rotate the bone in question a certain amount of degrees on each axis so it points the right way after all animations and lookat methods have taken place.
@Cherno, this has definitely fixed the axis for me, thanks a million. I still have a weird rotation issue but I assume this is to do with what you address using LateUpdate, I can accept your answer if you convert it
Done and done. For the second way of doing things, here is an example:
public Vector3 rotOffset = new Vector3(90f, 180f, 0f);//just play around with the values
public Transform bone;//the bone that needs a rotation correction
void LateUpdate() {
//any kind of Transform.LookAt code goes here before the next line
bone.eulerAngles = rotOffset;//might need to use localEulerAngles ins$$anonymous$$d
}
Your answer
![](https://koobas.hobune.stream/wayback/20220611235835im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Importing asset from 3d Max but texture isn't included? 1 Answer
Best importing method / recipe. 1 Answer
importing model into unity causing distortion 1 Answer
Unity Extensions 2 Answers
3DsMax Import Problem 0 Answers