Search Unity

3rd person freelook camera + over the shoulder camera

Discussion in 'Cinemachine' started by AaronMorrisV, Mar 23, 2020.

  1. AaronMorrisV

    AaronMorrisV

    Joined:
    Nov 2, 2016
    Posts:
    2
    Hey Gregory!
    I'm making a 3rd person camera system which has a wide freelook CM, and on key press, the camera blends to a close up freelook CM (to create a POV style perspective).

    My issue (as shown in the video) is that when the camera transitions to the close up view, the aim is "thrown off" instead of staying focused on the same point:
    https://www.youtube.com/watch?v=dmc4PYEKFTs

    At the moment, I am using two freelook cameras and when transitioning between them, I set the X and Y axis values of the camera being transitioned from, to the X and Y axis values of the camera being transitioned to. I believe that the reason that this doesn't work is because a given set of axis values on two differently configured freelook cameras does not result in equal camera rotations.

    I saw the example package you linked here:
    https://forum.unity.com/threads/how-to-make-a-aim-camera-with-cinemachine.710018/
    However, unfortunately this doesn't suit my needs as I would like a freelook camera in the wide perspective (although, in the close up perspective, I don't mind whether it's freelook or another type as long as it works in a POV style).

    Could you please help me to create such a camera system?
    Thanks :)
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    If you download the latest CM 2.6.0-preview.2, you will find a new sample scene: 3rdPersonDeadCenterAim. This demonstrates a new CM component that's designed to maintain a steady and accurate aim in a 3rd-person or POV style game - even with damping and noise on the camera.

    The paradigm is a little different: instead of the mouse controlling the camera orbit, the mouse directly controls the player orientation, and the camera positions itself relative to that. The example is set up to show an over-the-shoulder camera, but by adjusting the offsets you can turn that into a POV.

    Give it a try an let me know if it's the sort of thing you're looking for.

    upload_2020-3-23_9-35-36.png
     
    hawaiian_lasagne likes this.
  3. AaronMorrisV

    AaronMorrisV

    Joined:
    Nov 2, 2016
    Posts:
    2
    Thanks for your very prompt response, your solution wasn't exactly what I was looking for, however, using the resource which you pointed me to I was able to fix my problem by adapting the OverTheShoulderAim example! So thank you very much <3
     
    Gregoryl likes this.
  4. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    124
    @Gregoryl Wow thank you! This is exactly what I've been trying to achieve over the past day. I've noticed the jogging animation from these samples has a curve in the root motion that causes the character to veer to the right, hopefully that can be fixed for the next release!
     
    Gregoryl likes this.