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

Cinemachine - track object, lock camera rotation

Discussion in 'Cinemachine' started by AntLewis, Dec 18, 2017.

  1. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Hey guys, just getting to grips with this package. Basically I wondered if there's a way to set my cameras rotation to a value, then effectively lock that rotation while having the camera track a game object?

    Thanks for any help!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,623
    Sure. Set the Aim component in the vcam to "Do Nothing", and use the Framing Transposer in the Body.
     
    Last edited: Dec 18, 2017
  3. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    That's excellent - thanks for the response!
     
  4. GregoryFenn

    GregoryFenn

    Joined:
    Feb 13, 2018
    Posts:
    43
    Is there a way to not only lock the v-camera rotation, but keep it a fixed vector-position-away from the target object?

    For example, I want a ball to roll down a hill and hit posts and bumps so it will spin in random directions, and I want my vcam to follow it but not spin around any axes.

    ****

    SOLUTION FOUND: in the Body component, set Binding Mode to "World Space"
     
  5. Jubcow

    Jubcow

    Joined:
    May 28, 2018
    Posts:
    4
    You're a saint. World Space binding was exactly what I needed for a rolling ball camera. I had a script setting a regular camera offset before, but then I wanted to add Cinemachine to my project and it broke the gameplay camera, this made my Freelook cam functionally back to what it was. (but with the added benefit of cinemachine)
     
    OfficialHermie and GregoryFenn like this.
  6. BongFilter

    BongFilter

    Joined:
    May 2, 2016
    Posts:
    3
    :) thanks!
     
  7. sachinbirajdar

    sachinbirajdar

    Joined:
    Feb 23, 2017
    Posts:
    11
    I think this does not work with animated objects.
     
  8. Oknaa

    Oknaa

    Joined:
    Jul 22, 2019
    Posts:
    8
    Broo this is exactly what i was looking for ! Much thanks !!