- Home /
Problems importing FBX model from 3DS and applying movement
Greetings all.
We are working on a small project to know the unity and we are having some issues importing the models created in 3DS to Unity.
We created the character on 3DS 2011 with the biped and an simple animation. It looks fine on 3DS and when I import on Unity, it brings me the following structure:
So far so good. But when I check the properties of these objects, each one of it comes with a different rotation and scale:
Root Object (Zombie (1)) - Rotation 0,0,0 and Scale 1,1,1 Zombie001 - Rotation 90,0,0 and Scale -0.0254, -0.0254, -0.0254 Zombie002 - Rotation 0,180,180 and Scale -0.7 , -0.7 , -0.7 Bip001 - Rotation 270,90,0 and scale 0.0254, 0.0254, 0.0254
After importing, on the FBX importer tab I set the scale from 0.01 to 1 (we defined the right scale on the 3DS, so 1 works fine) and check the "Generate Colliders" Option.
When I add the object to the scene, the animation goes to the Root Object, the Zombie002 got the Skinned Mesh Renders but the Zombie001 is empty. I checked every child object (including everything in the biped) but I cannot find the collider it was supposed to generate.
When I try to add a collider (I tried Capluse, Box and Mesh Colliders), it is out of center with the texture, so I need to correct by hand.
After doing this, the object moves all wrong, usually going up, as if there was no gravity applied(and the is. I added the Rigid Body on it) and sometimes running backwards. My movement script is a simple one the align the zombie with the player and apply a force to move.
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
My questions are:
1 - What do I need to change on the 3DS file to import with the right rotation? On 3DS everything looks fine, with the right scale and rotation.
2 - Where I should apply the Rigid Body? (Root Object? Zombie002? Create an Empty?)
3 - How to fix the wrong movement? Change the way I move the object?
Thanks!!!
Answer by bisciasia · Apr 28, 2011 at 06:22 PM
for move correctly an object by using its tranform object you have to put rigidbody to kinematic mode. if you want that movement is under physics control you have to apply force to it without modify directly transorm. if you object move wrong,you can set constrains at you rigidbody bi using the inspector ;) rigidbody must attached directly on you game object ;)