- Home /
Third person controller script - model facing wrong way.
Hi,
I've a character model imported from Max and have applied the Third Person Controller script to it.
All is well with the actual movement of the model on the arrow keys, but the directions that the character model faces are incorrect:
Up key: model faces right
Down key: model faces left
Left key: model faces forward
Right key: model faces backward
Does anybody know how to resolve this, and also why it might have happened in the first place?
Many thanks.
Perhaps worth noting that I have the spring follow camera script on the main camera too, set behind the model.
Answer by Peter G · Jan 15, 2011 at 12:27 PM
This is a common problem. Create an empty GameObject, make your model a child of it, rotate the model so that it is orientated correctly. Attach the controller script to the (used to be) empty Game Object and move that instead.
Thanks, this has helped to get it looking correct.
$$anonymous$$y next question...given that my character model is now the child of the empty GameObject, where would I put the Third Person Player animation script?
It seems that this has to be in the same place as the controller script, but the animations are on the character model, not the gameObject.
If there's a way I can get this right without having the model in the empty gameObject I'd be very interested in knowing..
Cheers
Answer by Jim 6 · Jan 15, 2011 at 02:42 PM
Ok, I figured it out.
I grouped my mesh and biped in Max, rotated them so that the Z axis points up, the Y axis extends out the back of the character and the X axis points down the right arm (facing you).
I then ungrouped them and exprted as a .FBX file keeping Z-up in the export options.
This seems to have eliminated the need to parent the model to an empty gameObject and rotate it inside.
Sometimes when this happens with models I've purchased (I'm not a 3d artist) ins$$anonymous$$d of parenting it to an empty gameobject I just set the Z scale of the transform to -1 and it usually does the trick. But yeah, for some reason Unity has the z-axis backwards.
Your answer
Follow this Question
Related Questions
Physics2D AddForce Direction Vector Issue 1 Answer
Raycast between TransformDirection and Vector3.Forward? 1 Answer
Change characters direction using camera view 0 Answers
Model is facing the wrong way 1 Answer
Weird angle returned 1 Answer