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

How to transition from top to side view like Crash Bandicoot?

Discussion in 'Cinemachine' started by nantoaqui, May 6, 2021.

  1. nantoaqui

    nantoaqui

    Joined:
    Oct 1, 2014
    Posts:
    40
    Hello!

    I've been playing around with Cinemachine and it looks really powerful. I would like some guidance in how to setup cameras to achieve the following effect:

    https://imgur.com/F26J2eb

    The camera slight rotates as he climbs the stairway until it transition from top to side view.

    My approach was to setup 3 VCAM: Top view, Side view and one positioned at the stairway looking at the player:

    https://imgur.com/lfrZnx4


    VCAM Top view
    Screenshot 2021-05-05 223126.png


    VCAM Side View

    Screenshot 2021-05-05 223044.png

    VCAM Stairway

    Screenshot 2021-05-05 223012.png

    And i have a few Cinemachine Trigger Action responsible to change VCAM priority

    Screenshot 2021-05-05 222903.png

    My questions are:
    1. How would you achieve this effect?
    2. Is VCAM + Trigger Action the right tool for the job? I tried to use ClearShot but it doesn't seem to work with following target
    3. Is the VCAM Stairway really needed?
    4. I'm finding hard to change the active camera using colliders, like, detecting entry + exit side. Is there a better way to do it?

    Thank you for helping !!!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,143
    Sorry for the slow response.

    Generally, your approach is good. In the inspirational video, the movement on the stairs is a little more refined. The camera seems to align itself to be always directly behind the character (ignoring the character's flipping). That gives a nice effect. One way to achieve it is to create an intermediary invisible target with a custom script to always match the character's position and yaw, but with zero X and Z rotation. Then the vcam can have an ordinary transposer following the intermediary target at a fixed offset from it in its local space.

    For the triggers, a good approach is to overlap the trigger zones slightly, and each one should enable its vcam on enter, and disable it on exit. That way, they will chain nicely. The most-recently-enabled vcam will dominate the others at the same priority.
     
    gaborkb likes this.