Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Rotating Cinemachine POV through scripts

Discussion in 'Cinemachine' started by sevensixtytwo, Oct 8, 2018.

  1. sevensixtytwo

    sevensixtytwo

    Joined:
    Apr 5, 2013
    Posts:
    1
    Hi all.

    So I'm using a Cinemachine POV component to look around with touchsticks by modifying the input value. Is there any way I can orient the camera without using the touchsticks? I'd like to implement a "Reset Vertical Look" or even make the rotation gravitate towards the current softlocked target.

    Experiments with Quaternion.RotateTowards in various configurations have failed to produce any noticable results, at least until I turn off the cinemachine scripts which also disable my input. Directly modifying the input values is pretty innacurate.

    Here's an example of my project's gameplay:
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,820
    The axis Input value generates an impulse whose result is to change the axis's Value. You can manipulate the axis.Value directly from script as well.

    The POV component's m_HorizontalAxis.Value and m_VerticalAxis.Value represent the Y and X rotations, in degrees, from world forward if vcam is not parented to anything, or parent's forward if it is.