Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Collider causes camera to "jump" position

Discussion in 'Cinemachine' started by namcap, Jul 29, 2018.

  1. namcap

    namcap

    Joined:
    Jan 8, 2016
    Posts:
    2
    In a scene with lots of jagged walls (something like a cave), the FreeLook camera will jump between positions when trying to prevent occlusions with the jagged wall. The "camera radius" is set to as small as can be (0.05) without seeing inside of obstacles, but there's still some jumping. Is there any way to get the camera to slide along walls instead of jumping between positions? If I set the camera radius to 0, then no jumping occurs, but we'll also see inside of the walls.

    I attached a picture of my collider settings for reference. Thanks!
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,412
    You might have to add smoother wrapper colliders around your cave walls to reduce the jaggies. Or maybe go the other way: increase the camera radius so that it won't fit in the crevices. You might also want to bring up the DampingWhenOccluded param so that the camera returns to normal position more gradually after the obstacle is gone.
     
  3. namcap

    namcap

    Joined:
    Jan 8, 2016
    Posts:
    2
    Thanks for the response! Sadly, adding a smoother collider wouldn't be great for my use case and would be fairly expensive. Increasing the camera radius doesn't work great with the jaggies and causes it to jump around a bit more. Are there other options to play with for Cinemachine collisions?

    A simpler camera (like Unity's StandardAssets one) works better in this case, since when there's occlusion, just the Z position of the camera moves, giving it a smooth motion. Does Cinemachine have an optional strategies like this, better built to handle jaggies?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,412
    For movement only in Z, you could try setting the strategy to Preserve Height.

    Another setting you could play with is Smoothing. What that does is to resist pushing the camera back after having pulled it in, making things a little less chaotic. Combining that with well-chosen damping values might help.

    If all else fails, you could repackage the simpler collider that you like as a Cinemachine Extension and use it with the vcam.