Search Unity

How to do First Person and Third Person camera toggle using CinemaMachine?

Discussion in 'Cinemachine' started by Gubendran_Vins, Dec 18, 2020.

  1. Gubendran_Vins

    Gubendran_Vins

    Joined:
    Mar 20, 2018
    Posts:
    62
    Hi,
    Already I have Third person and Top view camera toggle, now I want include First Person Camera as well.
    What do I need to do for that. Please guide me.
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Hi,
    Would you like a guide on setting up First Person Camera?
     
  3. Gubendran_Vins

    Gubendran_Vins

    Joined:
    Mar 20, 2018
    Posts:
    62
    Yes
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    There are a few ways to do it.

    1.
    You can use a Do Nothing vcam (follow and aim behaviour set to Do Nothing). Place this vcam as a child of the player gameobject (possible as a child of the player's weapon). Then, manually position it in the player space the way you imaged your first person camera. This will result in a rigid camera behaviour.

    2.
    You can use ThirdPersonFollow. Have a look at 3rdPersonWithAimMode and AimingRig examples in our examples. You will need to modify the Shoulder Offset, Vertical Arm Length, and the Camera Distance parameters. With this setup, you'll have more options to fine tune the vcam.

    A major difference between the two is when you look up or down. In the first case (1.) the "weapon" will be framed the same way, it won't depend on where you look. Whereas, in the second case (2.) if you look up or down, the weapon will be a bit different. Have a look at the attached gifs.
     

    Attached Files:

  5. Gubendran_Vins

    Gubendran_Vins

    Joined:
    Mar 20, 2018
    Posts:
    62
    Thanks for your reply, I will try these two case..