Search Unity

[Solved] Problem with temporarily "unplugging" the Cinemachine brain

Discussion in 'Cinemachine' started by Seith, Sep 9, 2018.

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hil, I'm starting to implement a freelook Cinemachine camera and so far I'm loving it!

    I however hit a snag: while I want my main camera to be controlled by Cinemachine while I'm in play mode, I don't want it to be driven by Cinemachine while I work in the editor (in other words I want it to remain where I put it). I tried disabling the CinemachineFreeLook component, or even to deactivate the game object which has the CinemachineFreelook component but all it does is forcefully maintain the camera zeroed-out at the world's origin (?!). Which is of course a thoroughly undesirable behavior.

    So my question is: How do I temporarily "unplug" the Cinemachine brain? That is how can I simply tell Cinemachine not to do anything to my game camera (ie. leave it where it is) while I work in the editor?
     
    Adam_Myhill likes this.
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,710
    Just disable the CM Brain
     
  3. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Doh! I didn't even notice Cinemachine had added a Brain component to the game camera... Thanks!
     
  4. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Hey @Seith ! Super happy - honored - that you're working with CM. Please let us know how it goes. I'm an incredible fan of your work.
     
    Seith likes this.
  5. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you, Adam! I have to say I'm very impressed by the care and thoughts you've put into the free-look (3rd person) aspect of Cinemachine. I was able to reproduce (and improve) the camera of GoaT in a mere couple of hours. And all without a single line of code! :)

    Now I have to discover how to implement little cut-scenes. Like the camera going off to the side (to a predefined position) while the player character does something. And then going back to being interactive. Would you have any pointers or tutorials for that?

    Actually I have a couple more questions for you regarding the Cinemachine Collider script:

    - There is a little warning frame at the top, saying that "Avoid Obstacles requires a LookAt target". In the FreeLook component I indeed left the LookAt field empty, since I'm instead using the rigs (top, middle, bottom) for different Look Ats. Am I doing something wrong or is the Collider script complaining erroneously?

    - I would like the camera to pop forward very quickly (almost instantly) when an obstacle is detected but I would like it to pull back much more slowly when it's off the obstacle. And currently the camera pops back to the furthest distance as soon as it's off. Would you know how to achieve that?

    Cheers!
     
  6. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    This is pretty funny. I'm going to show you an example of how to do what you're asking... with GoaT assets! ha





    Now for your specific questions - that look at warning, yes it's a bug.

    Pop forward quickly and return slowly - there's some damping controls. Are you using the latest CM from the Package Manager?

    Damping - this is how fast the camera returns, probably the exact control you're looking for. The 'out' damping
    Damping when occluded - compression 'in' damping.
    Smoothing Time - sort of a delay, to filter out rapid changes
    upload_2018-9-10_2-40-59.png

    NOTE! We have a 'FreeLook2' coming out soon. It has a bunch of new features, is faster, and hopefully better in every respect. We can share a version with you if you're interested, just let me know
     
  7. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hehe, that's funny alright. I'll take a look at those. :)

    The damping settings you mentioned took care of my issue (I am indeed using the latest package version).

    And sure, I'd be willing to test FreeLook2...