What is the proper way to orientate a model in lightwave so that it will load into Unity properly.
Unity seems to automatically apply rotation to any imported objects making it dificult to use transform scripts. I usually model my objects along the + Z axis.
I checked the forums and documentation but couldn’t find this issue addressed. If information would be appreciated.
Shawn
If you attach the script to the same object as your MouseLook script the following would decrement sensitivityX by 1 everytime you pressed the “u” key until sensitivityX was 0.
function Update () {
if (Input.GetKeyDown("u")) {
myMouseLook = GetComponent(MouseLook);
if (myMouseLook.sensitivityX > 0.0) {
myMouseLook.sensitivityX -= 1.0;
}
}
}
I’m not sure if the previous response was meant for my question.
I tried importing an object in different rotations and found one that was correctly positioned for UNity. Does anyone know why Unity assigns a different rotation (270,270, 0) to imported objects?
Or is this more of an FBX export issue?
I think this has to do with LightWave exporting the mesh with Z as the Up axis. Why it does this I don’t know… there are still a handful of 3D apps that adhere to this oldschool orientation.
OK. I guess it’s easy enough to work around it for still model imports but animating will definitely be a pain if I have to animate objects as though z was up.
Has anyone come up with any usable workarounds?
Create an empty game object in unity. And make the the mesh a child.
Then rotate the parent so that the z-axis becomes y-axis.
The parenting works well when the object is being manipulated on it’s own. For a pond game, I created a frog model and applied a constant forward force to it. A keyboard input would allow the frog to turn. If I applied the movement scripts to the parent object, all works well.
I ran into a problem when I wanted to use a projectile (a gun that shoots flies). I parented a prefab fly object (the bullet) to a game object. The parent shot out of the gun properly but the child (the fly) didn’t have the same velocity and was turned the wrong way. I’m guessing that this is because I had to make the parent object a rigidbody so that it could be shot and that the physics didn’t transfer to the child after the initial force.
Suggestions for parented projectiles?
Thanks for the help.