Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help Wanted blend auto dolly Position offset based on nearest waypoint?

Discussion in 'Cinemachine' started by mightyDavros, Jun 22, 2020.

  1. mightyDavros

    mightyDavros

    Joined:
    Jan 2, 2017
    Posts:
    1
    Hi,
    I'm trying to set up an in-game camera in a tight room interior using a tracked dolly, with the path running down the middle of the room. The path is very simple, just 2 waypoints, one near the foreground wall, the other at the far wall.
    It almost works brilliantly, until the camera crashes through the foreground wall when the player walks toward the camera.
    So, I'd like to have a small position offset (ie close-up) when they're near waypoint 0, and then increase the value as they get closer to waypoint 1. Is there any way to do this without rewriting the auto dolly system?

    Thanks,

    Dave
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,805
    You can add a custom script to the vcam that manipulates the Z offset of the tracked dolly CM component as a function of player position. The Z direction of the offset is along the path.
     
unityunity