Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[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:
    703
    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:
    1,740
    Just disable the CM Brain
     
  3. Seith

    Seith

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

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    311
    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:
    703
    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

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    311
    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:
    703
    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...