I imported a fbx model from outside unity and it is not oriented properly. if try to use left/right keys it moves on another axis than forward and backward as I wish it moved. once I rotate the model it moves in the right directions but now the model is looking in the wrong direction. what am I not doing right here?
1 Answer
1Bringing in a model with the “wrong” orientation into Unity can be a real problem. One solution is to use an empty game object. Place the empty game object at the pivot point of your model with rotation (0,0,0). Rotate the model so that faces “correctly” (i.e. facing positive Z). Then make the model a child of the empty game object. Now attach the rotation code to the empty game object.
thanks, but how do I place the empty object at the pivot point of the model with rotation (0,0,0) ?
– JaymzUsually you do it in scene view. - Create an empty game object - In the inspector set its position to (0,0,0). - Move your model so that whatever point in the model you want to rotate around is at the origin (0,0,0). - Rotate the model until it is facing positive 'z'. In the default setup, you will see the back of the character in game view. - Make the model a child of the empty game object by dragging and dropping the model on the empty game object in the Hierarchy pane. - Place your rotation code on the empty game object.
– robertbuthanks but it still doesn't work. when I rotate the model (as a child of the empty object or as standalone asset) the axes are changing so left/right direction is changing too.
– JaymzScripts go on the empty game object, not on the model, so that left and right will be of the empty game object. The model just goes along for the ride. This does not work in all situations.
– robertbu