Search Unity

How to use Cinemachine Camera Offset

Discussion in 'Cinemachine' started by ElektroKnight, Jul 13, 2019.

  1. ElektroKnight

    ElektroKnight

    Joined:
    May 16, 2017
    Posts:
    3
    Hi! I'm trying to do a third person shooter camera, with character more to the left, using the Cinemachine Free Look and Camera Offset extension. But apparently the offset extension isn't being considered in the Collider extension, so it's like the camera offset is always (0, 0, 0). How to solve that?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,725
    It's a little tricky getting this to work well with a FreeLook. CameraOffset and Collider don't play well together.

    People have had some success using an ordinary vcam with FramingTransposer + POV. It works well with collider, and you don't need the CameraOffset. Here is an example scene with that setup. Give it a try and tell me what you think.
     

    Attached Files:

  3. praesidenter

    praesidenter

    Joined:
    Mar 5, 2016
    Posts:
    30
    Hi, I'm having the same problem with the collider not properly working when using the free look camera in combination with the offset extension. I tried the unitypackage from the previous answer and it's very jittery and doesn't feel as good to play as the free look camera even after finetuning the settings. You also lose the advantages and features of the free look cam and its different orbits, which is a shame because the free look camera and offset extension actually work very well together - that is until you consider collision.
    The POV workaround is not really a proper solution, I think, so I wanted to ask if there might be another way to have the free look camera and the collider work with offsetting the camera slightly to the side? To my understanding that is exactly what the offset extension is there for?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,725
    The POV solution should not be jittery. If it is, then you might be tripping over some other issue, or maybe you didn't integrate it properly with your project.

    One thing you might want to try in order to get the camera offset to work better with the collider: set the script execution order to be such that Offset happens before Collider. If you're using the latest version, the offset extension will adjust the LookAt point, so then collider will use the adjusted LookAt as a reference rather than the original LookAt.
     
    Last edited: Aug 17, 2019
  5. praesidenter

    praesidenter

    Joined:
    Mar 5, 2016
    Posts:
    30
    Unfortunately that doesn't work. I changed the script execution order like you suggested (by changing the meta files like mentioned here, but the results are the same - the camera clips through walls when I activate the offset. I'm using the latest version available for me from the package manager (2.3.5 - preview.3) in Unity 2019.1.6f1.