Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Getting Y-Axis movement to work with an OrbitalTransposer

Discussion in 'Cinemachine' started by SpectreCular, Apr 17, 2022.

  1. SpectreCular

    SpectreCular

    Joined:
    Jan 15, 2015
    Posts:
    44
    Is an OrbitalTransposer body supposed to allow for vertical Y-axis movement (rotating above/below the follow target)?

    I changed from a regular Transposer to an OrbitalTransposer to have my gamepad's Right Analog Stick orbit around the player, but it doesn't appear to be moving in the vertical Y-axis at all... Only the horizontal X-axis. I can confirm that the Input Provider is correctly receiving both axis values though.

    I also tried manually changing the Virtual Camera and Main Camera's transform properties in code, but it had no effect, and I later learned that Cinemachine doesn't really allow for this. I even tried out the ForceCameraPosition method but got some pretty weird results where, even if I attempt to pass in the camera's current transform, it warps to some crazy far away locations and then slowly transitions back to the player.

    What's the proper Transposer setup to also allow for both horizontal and vertical movement? Or can I not use a Transposer at all if I want to do this?

    Using:
    • Unity 2022.1.0b14.2951
    • Cinemachine 2.8.4
    • Input System 1.3.0
    My Settings:
    Screenshot_1.png Screenshot_2.png Screenshot_3.png
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    OrbitalTransposer provides a horizontal orbit only. You can see that if you open up the Body foldout and look at the settings.

    There are several ways to get CM to orbit both vertically and horizontally in response to user input while tracking a target. The right choice will depend on the kind of camera motion you want and the kind of game you are making. There are subtle differences. Cinemachine ships with some sample scenes you can look at. Here are some alternatives you can try:

    1. Replace the vcam with a CM FreeLook camera, with Follow and LookAt targets both set to your player character.
    2. Use a vcam with FramingTransposer in Body and POV in Aim, again with LookAt and Follow targets set to your player.
    3. Use a vcam with 3rdPersonFollow in the body, as detailed in this tutorial: