Search Unity

True First Person View

Discussion in 'Scripting' started by HandOfPriam, Jun 3, 2011.

  1. HandOfPriam

    HandOfPriam

    Joined:
    Aug 19, 2010
    Posts:
    34
    Hello all, I am currently working on a simple FPS demo as a way to learn the ins and outs of Unity. Anyways, I have been trying to figure out how to implement a true first person perspective (think Halo 2 -onwards). How should I go about doing this? Should I use a script to attach a camera to a bone the player model's head? If so, how should I go about scripting that? Thanks. :)
     
  2. increpare

    increpare

    Joined:
    Nov 17, 2010
    Posts:
    151
    What do you mean by true first person? This is something that the first person prefab bundled with unity won't suffice for?
     
  3. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    What you are probably looking for is called "full body awareness". It means that you have a sense of your body in the game world and not only a camera with a gun in the hand attached to it.

    How to achieve this?
    Pactise, test things and be ready for a whole lot of work. It's really a lot of work to achieve. The F.E.A.R. series has a very good FBA for example. You'll need an animated model that fits to your camera view and have that animated. Put the cam where the head would be and let it interact with the environment. Sounds easy - really is a sh**load of work to do right.
     
  4. HandOfPriam

    HandOfPriam

    Joined:
    Aug 19, 2010
    Posts:
    34
    Would I just make it a prefab then, if I can just place the cam in the editor?
     
  5. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    From the concept of you what you are talking about you need a camera based in the model's head. So it's pretty advanced.

    Basically you write a controller for head look which is based on the mouse look standard script in the Character Controller standard assets. It's not going to be simple, but it can be done.

    Givin this is your first posting here. Are you comfortable with getting into advanced scripting right now? Perhaps a simpler project would better help you understand Unity before getting into something heavy. ;)

    If you have not went through the basic tutorials for Unity, you should do that first.
     
  6. HandOfPriam

    HandOfPriam

    Joined:
    Aug 19, 2010
    Posts:
    34
    That makes sense. :)

    I have been poking around with C#. I know Java and C++, so it hasn't been too difficult for me to get the hang of. As for the project, it's more of a learning experience to see what I can do and implement. It's my scripting sandbox. :)

    As for the last part, I have been messing with the tutorials. I actually have been manually rewriting all of those Javascript scripts as C# scripts, so they've helped me to both learn C# and how Unity works.

    Thanks for the advice. :)