Search Unity

Camera settings for a flight controller?

Discussion in 'Cinemachine' started by mstewart52178, Apr 10, 2022.

  1. mstewart52178

    mstewart52178

    Joined:
    Feb 8, 2022
    Posts:
    19
    I'm somewhat new to Unity and still trying to figure things out, but I am trying to adjust my camera settings for my controller. The intended affect I am trying to achieve is a third person view of the plane that can rotate freely in all directions and be able to do a barrel roll side to side without the camera rolling with the plane. Attached is a screenshot of my current settings which, for the most part, achieve all of what I attempt to do. The only issue is that when the plane rotates up or down 90 degrees, things go wrong. The planes other two axis will alternately do a 180 between the two when the up/down axis hits 90. I know virtual cameras don't do well looking up and down, but it was the only way I knew of to have a camera that would allow a barrel roll without the camera spinning along. The camera is not a child of the plane. For movement and rotation I am using AddRelativeForce and AddRelativeTorque in FixedUpdate. Screenshot (1).png
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Have a look at this video:
    .
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    What happens if you assign the plane to the CMBrain's World Up Override?

    upload_2022-4-13_16-11-59.png
     
  4. mstewart52178

    mstewart52178

    Joined:
    Feb 8, 2022
    Posts:
    19
    If I remember correctly; I think I did try the world up override, but it did not work. I ended up clamping/limiting the x-axis rotation, so that my character is just short of looking straight up or down. It's not vital that my character look straight up or down(moreso just an observation of the controller behavior), so for now I'm content with the fix. I really appreciate the replies and help offered. Thank you.