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 Free Look Camera Not Rotating 360 Degrees On Linux Editor Or Builds

Discussion in 'Linux' started by gamesimadeforfreya, Mar 31, 2021.

  1. gamesimadeforfreya

    gamesimadeforfreya

    Joined:
    Aug 19, 2019
    Posts:
    3
    Hi,

    I have a simple enough project with a character controller and cinemachine free look camera. The camera works fine on windows 10 but on Linux (Ubuntu Mate) the mouse hits the edge of the screen and then it just stops rotating. This is happening in both play mode and when the project is built.

    Is this a bug or do I have to do something extra to make it work on linux?

    Thanks in advance!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Cinemachine is just reading the input system with Input.GetAxis("Mouse X"). If you make a script that does that and logs the result, what happens when your mouse hits the edge of the screen? If you stop getting input, then this is a question for the input forum.
     
    Last edited: Apr 1, 2021
    gamesimadeforfreya likes this.
  3. gamesimadeforfreya

    gamesimadeforfreya

    Joined:
    Aug 19, 2019
    Posts:
    3

    Thanks for the speedy response. Just tested that and yes indeed mouse input goes down to 0 when I hit the edge of the screen.
     
  4. KevinWelton

    KevinWelton

    Joined:
    Jul 26, 2018
    Posts:
    239
    This is an unfortunate limitation we're running up against with X. X does not give mouse deltas, only absolute positions. We've tossed around some ideas for addressing this in the editor, but it's not as simple as it sounds :(

    If anyone in the community DOES know how to get a mouse delta in Linux using pure GTK or X, feel free to share. We are avoiding reading input directly as that would make our maintenance story much harder.
     
    twobob likes this.
  5. loconeko73

    loconeko73

    Joined:
    Aug 13, 2020
    Posts:
    17
    Hi. I think I'm hitting this same problem. I have a build that works fine on Windows, but on Linux the free look camera (I'm using CM with the Starter Assets' third person controller) either fails to move or jumps around madly.

    Any idea of a workaround ? Can't I just store the mouse position in an Update(), get the difference with a new position and pass the delta myself when doing onlook() ? How would I go about that ?
     
  6. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Maybe the people over at https://github.com/opentk/opentk/ might have some bright ideas? Can't hurt to ask.
     
  7. loconeko73

    loconeko73

    Joined:
    Aug 13, 2020
    Posts:
    17
    Just to follow-up, my issue did go away with a downgrade of the New Input System to 1.0.1, so not Cinemachine related after all, but new input system.