Search Unity

Cinemachine and UFPS

Discussion in 'Cinemachine' started by AndyNeoman, Mar 18, 2019.

  1. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi all,

    M firsyt attempt at using cinemachine and following the tutorials and videos is not possible as I use UFPS for the character controller and it is interfering with the setup. Has anyone got any tutorials using them together (is it possible) or is there a work around. I'm trying to setup a simple cutscene with the timeline and cinemaahine tracking a character in a cutscene.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    I'm not familiar with UFPS, but often these controllers are trying to control the main camera directly, which is in conflict with Cinemachine because Cinemachine is also trying to do that.

    The way to fix it is to open up the controller, and replace the Camera behaviour with a CinemachineVirtualCamera behaviour with Do Nothing in Aim and Body. You can either delete the embedded Camera behaviour, or just disable it. You may have to edit some controller code as a result of this change. If the controller is tagged as the MainCamera, untag it. This converts your camera controller to a virtual camera controller. The virtual camera's transform is controlled by the controller behaviour.

    Then, create a new top-level Camera, tag it MainCamera, and add a CinemachineBrain component to it.

    If you don't have any other virtual cameras in your scene, main camera with the brain will now automatically track the UFPS controller exactly, as if the main camera had the UFPS behaviour on it.

    Now that UFPS is a vcam instead of a camera, you can use it as you would any other vcam, it will play nicely with all the other vcams in your scene, including blending, noise, impulse, and timeline.
     
    Last edited: Mar 20, 2019
    AndyNeoman likes this.
  3. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks for that explanation. I will get it a try.


    EIDT Hi @Gregoryl I don't suppose you have tutorial for that? I thought adding using cinemachine.utility would allow me to change to virtualcameras but the scripts not accepting it.
     
    Last edited: Mar 20, 2019
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Sorry, I don't have a tutorial. Like I said, I don't have specific experience with UFPS, so maybe nothing I said is even correct for this case, or maybe you'll have to massage the UFPS scripts a little to get it to work.
     
    AndyNeoman likes this.
  5. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I've been advised to turn off the ufps camera on cutscene event and re-enable it after it's finished. Hopefully this will stop the clash. I use dialogue system too and that has integration for both cinemachine and ufps.