Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

CinemachineCollider not working?

Discussion in 'Cinemachine' started by Kev00, Jan 2, 2020.

  1. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    229
    I have an object that is racing down the inside of a pipe. I'm trying to use the cinemachine collider to keep the camera inside the pipe, but regardless of what settings it doesn't always stay inside.

    upload_2020-1-1_19-57-21.png


    The virtual camera usually stays inside the pipe, but the faster I make the object travel the more likely it will not stay inside.


    upload_2020-1-1_20-1-54.png

    I suppose I could add a script to the vcam to keep it from exiting the pipe, but I was hoping to get it working without that.

    Any thoughts?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    The CM collider will try to pull the vcam towards the lookAt target - probably that's not what you want. You'll probably get the best results with a custom CM extension to replace the collider. Find the closest point inside the pipe to the vcam's position, and put the vcam there.
     
  3. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    229
    ok thanks. I'll give that a try.