I have a simple tank model,
but for some reason, when it is imported and I place it on the ground of my level. The X and Y are rotated by -90 (or + 270) degrees. This prevents it from aiming correctly at the player when I apply a lookAt script to it.
here is the script
var myTransform : Transform;
function Update () {
transform.LookAt(myTransform);
transform.rotation.z = 0;
transform.rotation.x = 0;
}
However in MAX, my pivot points are OK. And the script works OK as well. I am positive that this is caused by the model, because I have applied the same script to a cube with a rectangle parented to it, and it behaves as it is supposed to.
What is it that I have done wrong with the modeling ? Any idea ?