Search Unity

3D follow camera in cinemachine

Discussion in 'Cinemachine' started by muhamad1987, Apr 8, 2020.

  1. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    Hello everyone, I want to follow my player in a 3d game and want it to perform as a free look camera but it just keeps bouncing and inverting the mouse movement although I unchecked the invert checkbox.
    For another question, what is the most advised technics for selecting a camera if I want like a god of war type of game? (i know it's a lot hehe, but I want to try anyway) , i mean when i am reaching an area the camera will follow the player, in another area to stay in the same position and only look at the player
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Can you show the inspector for the FreeLook, and an image of the object hierarchy, including the player, the FreeLook, and the main camera?

    Normally you will make a second vcam, with the desired settings. When the time comes, just activate it (enable it or raise its priority). The CM Brain will take care of blending from the previous active vcam. Afterwards, deactivate it (or lower its priority) and the camera will blend back to the previous one.

    There is a handy script (CinemachineTriggerAction) that can help with this, if you are activating when the player enters a trigger region.
     
    muhamad1987 likes this.
  3. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    thanks for the fast reply, well it just the basic settings, i want it to perform as if i look around with my player and the camera will stay behind the player
     

    Attached Files:

  4. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    so if i move the mouse it rotates badly , i don't know how to explain , if you would like i can record the screen
    just for your information i move my character by clicking on a position in the game not with the arrow keys
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    You have DoNothing in the aim, so the FreeLook's position will just orbit around the player, but it's rotation won't change. You need to put Composer in the Aim section for all 3 rigs, and add the player as the LookAt target. This instructs the camera to look at the target, in addition to orbiting it
     
  6. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    thanks man, i added the target in the aim section as you said and its more convenient to manipulate
     
  7. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14

    how do i get an explanation about this, basically i tried to play with priorety and distance for a bunch of cameras but i was confused , so where can i find more explanation about this
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Have you looked at the example scene that come with CM? Look at the TriggerVolume sample, it shows how to switch cameras using a trigger volume.
     
    muhamad1987 likes this.
  9. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    I just can't find them, sorry for that , i looked in the packages folder , is it suppose to be a scene?
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    You find them here, it imports them into your project. You can delete them afterwards.

    upload_2020-4-8_13-5-18.png
     
    muhamad1987 likes this.
  11. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    Great i will look into it, thank you very much