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 Rotate virtual camera full circle around target (CinemachineVirtualCamera)?

Discussion in 'Cinemachine' started by Brother_77, Sep 2, 2023.

  1. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    226
    I have a Freelook camera set up to follow player and on its death through CinemachineBrain it blends to Virtual camera, with Easeout. How to make it so it rotates around the Player as it does blend out to the other camera ?

    Tried searching, but most of the information is on rotation settings / rotate on mouse input.
    Also this search did not return any results in forums
    Thank you for your time!
     
  2. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    73
    I used a virtual camera on a dolly path to do exactly that
     
    Brother_77 likes this.
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    @Brother_77 Have you tried setting the vcam's blend hint to SphericalPosition or CylindricalPosition? That's what those hints are for.
    upload_2023-9-5_8-43-20.png
     
    Brother_77 likes this.
  4. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    226
    On the CameraBrain the custom transitions are set "from" and "to" and "what blend", when I change the Transition - Blend Hint it only does a spherical half turn to the other camera.

    Instead when after the transition I would need the new camera to look at player and do a full circle around it.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    I don't think I understand what you want the camera to do. People use Cinemachine in all kinds of ways, and I don't know what the context is here. Can you walk me through step by step, describing the outgoing camera, the incoming camera, what they are doing now, and what you would like them to do instead?
     
    Last edited: Sep 5, 2023
  6. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    226
    Freelook cuts to regular Virtual, and then Virtual rotates full circle (over time [fast/slow]) around the player which is set as Look at?
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    So you want to cut to a camera that continually orbits the player while looking at it? Ok, so this has nothing to do with transitions, the blend hint isn't relevant except during the transition itself.

    There are a number of ways to make an orbiting vcam. One way is to use Composer and OrbitalTransposer. In the X Axis of the orbital transposer, remove the default "Mouse X" from "Input Axis Name" and put a constant value in "Input Axis Value". That will make the camera orbit by itself. Larger values make it orbit faster. You can drive this value from script. You can play with the various other settings to get the motion you want.

    upload_2023-9-6_6-42-17.png
     
    Brother_77 likes this.
  8. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    226

    Thank you, after trying out the settings, dolly path was what I needed. Found a script that generates a perfect circle from the Dolly Track. It would be awesome to have some path shapes built in with cinemachine - circle, triangle, square, spiral ?

    https://gist.github.com/staggartcreations/d223b70e2af2b7b2947d9d2c3453cc01

    Blend from Freelook Camera to a Dolly Track Camera through Brain custom transitions "Cut" which then triggers a custom animation on which the camera follows the track points.