Search Unity

Gradually moving to the bounds of a 2D Confiner

Discussion in 'Cinemachine' started by Igotlazy, Dec 24, 2019.

  1. Igotlazy

    Igotlazy

    Joined:
    Jan 15, 2018
    Posts:
    65
    So I'm trying to set up bounds for my 2D camera (currently set to Perspective and not Orthographic). I want to have it so as the camera approaches the bounds of the Confiner, movement increasingly slows down in that direction, basically creating a much softer stop once the camera reaches the edge. How can I do this?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Unfortunately that feature is not built into the confiner. You'll have to write your own script.
     
  3. Igotlazy

    Igotlazy

    Joined:
    Jan 15, 2018
    Posts:
    65
    Is there anyway to expand the current confiner to do this or not really?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    You can always duplicate CinemachineConfine.cs into your assets, rename it, and modify as you please. Your new customized version will appear in the vcam Extensions dropdown automagically.
     
  5. Igotlazy

    Igotlazy

    Joined:
    Jan 15, 2018
    Posts:
    65
    Alright sounds good. Any tips for getting the behavior I want given the base Confiner code?