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

Lock Z-rotation

Discussion in 'Cinemachine' started by lobachevartem, Aug 9, 2020.

  1. lobachevartem

    lobachevartem

    Joined:
    Dec 14, 2019
    Posts:
    2
    hello i have a problem with freezing rotation in z axis. There is an airplane and a cinemachine free look camera is attached to it. When the plane rotates along the Z axis, the camera rotates with it. Is it possible to somehow block only one axis of rotation?
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Change the binding mode to Lock To Target No Roll
     
    APSchmidtOfOld likes this.
  3. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    Sorry for reviving this but for some reason my camera does actually rotate on z-axis even though I set it to Lock To Target no roll on all freelook cameras I am blending between... What could be the reason for that?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Can you show a video? Also: what version of CM?
     
  5. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    I am using Cinemachine 2.7.9

    Granted in this example only the close up camera where one machine is visible is set to "no roll". The one where both machines are visible is set to "world space" But even then I dont get why the camera does tilt going both ways...

     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    It looks like a blending issue. Do you have any blend hints set? Can you show the inspectors of both vcams?
     
  7. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    This is the one where one machine is visible.
    Bildschirmfoto 2022-02-25 um 17.01.18.png


    This is the one where two machines are visible.
    Bildschirmfoto 2022-02-25 um 17.01.27.png
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    What happens if you set both blend hints to Cylindrical Position?
     
  9. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    Same behaviour...
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Very strange. Do you think you could put together a sample project (just with cubes etc) that shows this camera glitch and send it to me?
     
  11. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    Yes, I will try to reproduce it!
     
  12. MSachs

    MSachs

    Joined:
    Nov 22, 2017
    Posts:
    117
    I sent it to you via DM.
     
  13. afshin_a_1

    afshin_a_1

    Joined:
    Apr 26, 2015
    Posts:
    48
    @Gregoryl
    what was the result?
    i also want to lock position movement in one axis and also locking rotation.
    of cinemachine virtal camera
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    It was something in the project. Can you start a new thread with a description of your specific issue?