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:

52042-capture2.png

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?

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.