UCC camera switch to Cimemachine (Bug or my lack of knowledge?)

JohnG

Member
I have created a view type that switches between the standard 3rd person adventure, to cinemachine (and back again when needed). I toggle the views using

C#:
        cameraController.SetViewType(UnityEngineUtility.GetType(viewadv), false);
        cameraController.SetViewType(UnityEngineUtility.GetType(viewcm), false);

As per the images:

This is the camera gizmo for viewadv. Red cube is just to show background so you can seem outline of camera.

1611881162831.png

This is the camera gizmo for view viewcm when I switch.

Screenshot 2021-01-28 193721.png

This is the camera gizmo when I switch back from viewcm to viewadv, which as you can see from image 1 is different even though I have definitely switched back to the viewadv view.

Screenshot 2021-01-28 194545.png

I dont know what the white box is called (clipping plane near?), but its different from the image 1.

EDIT: On some extra testing I found that the clipping plane near for image 1 is 0.01, then gets switched to 0.1 when I switch to cinemachine, then when I switch back to 3rd person the clipping plane stays at 0.1. The clipping plane has not been changed in code by me. I dont think this is how you want it to work?
 
Hmm, that must be Cinemachine setting the near clip plane when a virtual camera is active. The character controller only sets it when you are adding a first or third person view type.
 
Top