Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question cinemachine 2d setup

Discussion in 'Cinemachine' started by VP_no1, Dec 2, 2021.

  1. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    Hi.

    I would like to achieve with C2d ortographic the following:

    1. be able to fix the camera while i am hitting a collider (so that i will not see empty screen)
    2. have some special points to zoom in and out when triggered
    (i am in a platformer)

    for 1
    I solved it with Cinemachine Confiner 2D

    I would like though to have my Confiner polygon moving on X axis once the player is around 25% from the margin of the confiner in right. I tried with a distance joint connected to the player but it moves immediately. How can I have the confiner moving only when player reach a zone without coding ? For example when reaching the X margin of death zone, the confiner to move in that direction ?
    (maybe a feature for future :) ?)

    i have a long map and if i cannot do this then i would need to make a very very long confiner :)


    for 2
    I need to have different cameras or I just need to have some trigger spots and when my follow GO (or there might be 4 as I said on 1) to manipulate the lens ortho size of my only camera ?

    thank you in advance for any idea
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,222
    1. What's wrong with a very long confiner? Just use that.
    2. Create a trigger collider and add a CinemcahineTriggerAction script to it. When the player enters the zone, activate a new vcam with the desired ortho size. Cinemachine will blend to it. When the player leaves the, deactivate it.
     
    Last edited: Dec 2, 2021
    VP_no1 likes this.
  3. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    1. I allready did and i think that it wont have problems as is just a simple collider

    2, thank you, will do that and come back with good or bad results :)
    have a nice day