- Home /
How to make a mesh into a FirstPerson Character?
I got a mesh, it's riged and it got an animation.(made in blender) I already exported it to Unity in a .fbx file
Now my question is : How can i get this mesh into a Character that i can control? I want it to be in a FirstPersonView. How do i do this? I'm not very experienced with unity and can't find a good tutorial on the web.
I need directions, steps by steps. What to do first.
Also when i add a camera to my mesh and add the mouselook script to the camera, the camera rotates but the body doesn't rotate withit. and when i add the mouselook script to the mesh instead the camera, the mesh can rotate around but when i look up or down the entire mesh moves withit. can i make it so it only moves the head when i try to look up or down and just when you look left or right the whole mesh moves with it?
As you can see in the first picture, when i rotate the camera to the left and right, the body doesn't move withit. And in the second picture you see the mouselook script attached to the mesh, but when looking down or up withit. the entire mesh looks down to, i wish to be that only the head would move up and down. and in case of looking left or right that the whole mesh moves withit.
I hope someone can help me. ( if you know a link to a video that can help me i would really appriciate that)
-Hexer
Answer by gardian06 · Jul 25, 2013 at 02:50 PM
the best suggestion I can give is to maybe even break it into 2 different scripts.
script 1 placed on the head controlling the up and down motion
then script 2 placed on the body controlling the left and right motion.
you could probably accomplish this with a single script, but you will probably need to have the part of the script only modify the correct object. so create a transform variable in the script, and then have the specific part of the script modify that transform.
for example if the script is to be placed on the body (for turning) then create a Transform look;
then in the section for looking up and down use the look transform instead of the current transform.
thanks for your answer :) , I just figured out that i can delete the capsule mesh from the FirstPersonController and add my Character mesh to it.
But still i have to figure out how to move the head up and down. Do i need to add an animation for it? and then make a script within the animation. that will mean i have to make 2 different animation right? one that looks up and one that looks down. And then make a script to get it work.
like I stated in the last paragraph of my answer. in the script add a variable for a public Transform, and then assign the head portion of the model to it.
there is a slight assumption here that the head portion of the model is a sub-model-mesh inside the character $$anonymous$$odel. if they are a single piece then I am not sure how to accomplish that goal without animating, but the issue you might run into is having to freeze animations based on how far to rotate the head, and then bringing it back to neutral. which can get to be quite specific.
Answer by TK5005 · Jul 25, 2013 at 02:37 PM
You may want to take a look at the third person character controller prefab that comes with Unity. You should then be able to change the camera so that it appears to be first person, or even add another camera that is parented to the player so you can switch back and forth.
Your answer
Follow this Question
Related Questions
Blender animation walk in unity 1 Answer
Problem with getting the animation on my Character. 1 Answer
Camera shall stay on face while animating a Character 0 Answers
My Y-Axis on my camera wont work when I use an animation, help? 0 Answers
How to make FPS player camera see only arms and not anything else? 1 Answer