Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

how to create a camera system like this

Discussion in 'Cinemachine' started by HassanNew, Jun 29, 2020 at 9:06 PM.

  1. HassanNew

    HassanNew

    Joined:
    May 28, 2020
    Posts:
    4
    hi
    i want to create a camera system like this can anyone tell me how or send a tutorial relateing to that the video is just 30 seconds long please watch it and let me know if it is possbile to create a camera like that
    here is the link
     
  2. MlleBun

    MlleBun

    Joined:
    Sep 19, 2017
    Posts:
    92
    Hi, there are three main cameras from the video :
    • Third person camera where you can rotate around the player (and his movement is relative to the camera). Bonus It seems that the TPS cam is used in the Dash movement, but with a change of FOV (generally to simulate speed).
    • Aim or Strafe camera when the player is aiming, where the camera is following the player's orientation. The player rotates, so does the camera.
    • Menu camera where it is a still shot with the UI.
    You could achieve all of them using Cinemachine, so I recommend to simply have a look at the official videos
    TPS - Look for Cinemachine FreeLook camera tutorials. For Dash, here you could change the FOV through script or use State-Driven Cameras (see link below).
    Aim/Strafe - Well, it's linked to your animations (so States in your Animator). I would suggest looking at State-Driven Cameras. Or you can also trigger a Virtual cam with a simple Framing Composer attached to the player through script. Maybe others can have a better idea.
    Menu Cam - Another VCam that snaps to a given locator on your character (this locator should follow the root to avoid glitches) or again State-Driven Cam.

    Also, with Cinemachine, you can activate/deactivate the cameras through scripts (inputs for instance) and they will all blend together when transitioning from one another.

    Hope that helped!
     
    Gregoryl and gaborkb like this.
  3. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    144
    Roughly, they are using 3 different camera types:
    • At 0:00-0:06 MenuVcam
    • At 0:08-0:10 MultiTargetVcam (follows the character, but looks at the mouse -> character orientation does not matter).
    • At 0:11-0:12 ThirdPersonVcam (follows the character, and looks where the character looks -> character orientation matters
    You would have to create these three virtual cameras (MenuVcam, MultiTargetVcam, ThirdPersonVcam).
    MenuCamera
    This one depends on how you want to set it up. You could create an Do Nothing vcam, that is attached to the head of your character the same way like in the video. Or a vcam that trackes the head, and looks at the UI element when present. Should be simple.

    MultiTargetVcam, ThirdPerson
    For MultiTargetVcam and ThirdPersonVcam check out our examples. Check example scenes: 3rdPersonWithAimMode, AimingRig.


    Once, you have your vcams, then you can switch between them. You can make a vcam the active vcam by changing the priority property of the virtual camera. CinemachineBrain will always select the vcam with the highest value.

    There is a nice blend when they switch from each camera type. To achieve this, you can setup blends. Check CinemacineBrain component on the main camera. It has a field called Default Blend and Custom Blends. You can create your own custom blend (click on create asset), where you can specify the behaviour when switching from vcam A to B, B to A, C to any, any to B, etc.

    Let me know if you need clarification or further help ;)
     
    Gregoryl and MlleBun like this.
unityunity