Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta 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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Don't miss out on the Unite LA Keynote for the latest information from Unity! Set a reminder!
    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

Collider causes camera to "jump" position

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

  1. namcap

    namcap

    Joined:
    Jan 8, 2016
    Posts:
    3
    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,648
    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:
    3
    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,648
    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.