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

Does "Invert" Mean Something Different for the X-Axis and Y-Axis?

Discussion in 'Cinemachine' started by SonicBloomEric, Nov 21, 2021.

  1. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    1,085
    I've been struggling to get my head around what I assume to be default controls for the Free Look Camera. With no axis inverted, I see this:
    • X-Axis: The camera itself moves opposite the direction you move the joystick/mouse.
    • Y-Axis: The camera itself moves in the same direction you move the joystick/mouse.
    Is this actually how this is supposed to work by default?
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Yes.

    By default, in our examples or when you instantiate a freelook vcam from GameObject -> Cinemachine -> Freelook, you will get the following:
    Freelook-default-input.png

    This behaves, like this:
    • X-Axis: The camera moves in the same direction you move the joystick/mouse, i.e. if you move your mouse left, the camera also moves left.
    • Y-Axis: The camera moves in the same direction you move the joystick/mouse, i.e. if you move your mouse up, the camera also moves up.
     
    SonicBloomEric likes this.
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    @SonicBloomEric It's unfortunate that "Invert" does not have a consistent meaning across the axes (which I presume is what you're complaining about). It was a poor choice that sadly we are stuck with now, at least until the next major API overhaul.
     
    SonicBloomEric likes this.
  4. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    1,085
    @Gregoryl Yes, that is correct. While I do think it's odd, I noticed in my searches that Cinemachine didn't initially support the ability to invert the axes internally. My assumption is that this inconsistency is based on the original "default configuration" for axes.

    That said, if I'm complaining, then it is about the lack of documentation about how the axes are intended to work. The UI makes them appear identical. So when you try to decode what's going on, you start having to run tests to figure out if your control input is somehow getting wonky or if there's perhaps a bug in Cinemachine itself. Would have saved me a lot of time if the inconsistency had been documented somewhere - I definitely scoured the documentation first.

    To my mind, this would make the most sense to document in the Properties table for the component. Right now, the property is listed as:
    • Y Axis, X Axis - Invert - Check to invert the raw value of the input axis.
    It would be much clearer if this were to read:
    • Y Axis, X Axis - Invert - Check to invert the raw value of the input axis. The X-axis and Y-axis have opposite defaults. Where checking this box causes the view to move opposite the input for the X-axis, checking the box for the Y-axis will cause the view to move in the same direction as the input.
    Or something. It is surprisingly difficult to communicate what's going on because the position of the camera itself is itself "inverted" from the effective change in view... I'm sure you have worked out a better way to communicate this sort of thing, though!

    Hope the feedback helps!
     
    Gregoryl likes this.