Search Unity

Cinemachine Freelook x New input system - crazy sensitivity issue

Discussion in 'Cinemachine' started by Escuriak, Jul 8, 2020.

  1. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    Hey there,
    I just upgraded to cinemachine (2.6) and added new input system (1.0.0).
    I setuped keyboard/mouse ad gamepad controls. Hooked new Cinemachine Input Provider into a Freelook camera.
    When i run game, freelook camera (3rd person) is flying around on the smallest movement of mouse or gamepad stick. It looks like sensitivity went crazy. It worked like a charm on old input sytem :(
    Am i misssing something? In a blog post i read that there should be some example for new imput system shipped with CM 2.6 but i cannot find it.

    Some relevant settings:
    - mouse in Input Action is used through Value/Vector2, Delta Mouse and it is Normalized Vector2 (without normalizing mouse is even more sensitive
    - pretty default camera settings:

    upload_2020-7-8_17-23-21.png
    upload_2020-7-8_17-24-18.png upload_2020-7-8_17-24-32.png

    thank you all for help
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Does the problem persist if you disable Cinemachine Collider?
     
    Last edited: Jul 8, 2020
  3. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    yes, it still persist :(

    i just have a second thoughts on how to describe this problem. it looks like that camera is moving with a constant speed in game... probably caused by Normalize ... so either its moving on axis with Input Axis value 0 or 1 ... nothing between, that could cause that weird movement at the first place.

    but on the other side, when i disable normalize, camera is going crazy how i described it before. its almost imposible to control it with the mouse
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    I don't see anything that pops out. Could you send me your Player Controls, that you use for XY axis?

    Change from max speed to value gain on your Freelook's Axis Control. See the attached image.
     

    Attached Files:

  5. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    Hey there Gabor.

    Thank you for your help. I really appreciate it.
    Changing MaxSpeed to ValueGain is making camera even crazier ... like sensitivity 3000 :D

    Anyways. i replicate this problem in a new project, made a github repo with cinemachine as default without new input system.
    then i made a branch where new input system is implemented and cinemachine is configured to use it. i didint do any special settings (expcept orbits for rigs). also created two videos with different behaviours.

    repo:
    https://github.com/ludovitkapusta/cinemachineXnewInputSystemTest
    branch with new input system
    https://github.com/ludovitkapusta/cinemachineXnewInputSystemTest/tree/implemented-new-imput-system

    also here is a pair of videos:
    cinamchine without input system, just one freelook camera and thats it... its working just fine:
    https://drive.google.com/file/d/1zdGA6_-oRY2DYf28YIDbmq77qiB_WpBG/view?usp=sharing

    and video with comentary with input system:
    https://drive.google.com/file/d/1ORgo6NJPOypqI7ugl-wkoEBy4613GZW2/view?usp=sharing

    Hope this helps
    THANK YOU! <3
     
    gaborkb likes this.
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Note: input value gain interprets Speed as a direct multiplier for input values. You can't leave it at 300! Put it way down. Start with 1 and see what happens. Also, normalizing the input is a bad idea, as you indicated. Leave it un-normalized.
     
  7. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    yep, when i set Value gain, i put input values to 1, as a part of testing... but it was still way off. on th ether side, i was changing it in play mode, but that should be fine, right?

    also i got rid of normalize in repos, so it should be fine to test
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    For me it's fine with these settings:

    upload_2020-7-9_12-34-50.png

    upload_2020-7-9_12-35-5.png
     
    mattouBatou likes this.
  9. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    Thank you for your help guys :)

    im not totally satisfied with the result as it is not as smooth as it was without input system, but with your advices its still a way better then what i was able achieve with input system so far.

    i eneded up with these settings (default windows sensitivity with 800dpi mouse)
    upload_2020-7-9_19-24-38.png

    And for the gamepad in Input Actions, i had to set up Processor Scale Vector2 so these new Speed settings will be scaled:
    upload_2020-7-9_19-30-41.png
    (will probably play more with these scaling to fit my preference)

    so leaving this here as it may help someone in future
     

    Attached Files:

    gaborkb likes this.
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    There's your problem. Turn these down (or get rid of the scale) and you won't have to compensate so much in the CM axes.

    upload_2020-7-9_14-0-56.png
     
    gaborkb likes this.
  11. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    :) nooooo :D

    the scaling was added after adjustments according to your last message. and it is applied only for GAMEPAD stick, not mouse

    sorry for creating a chaos...
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Well, why do you scale it so much? You're having to divide it by 1000 in the Y axis. Why not scale it by 0.1 instead, and have more reasonable values in the FL axes?
     
  13. Escuriak

    Escuriak

    Joined:
    Sep 24, 2015
    Posts:
    7
    hmm... i understand what you trying to say, good idea.

    Those FL axes was initially set up to cover mouse and its movement. mouse is without any scaling, so with those values from my image above, it work somehow ok.
    then i tried to control camera through gamepad, and it almost didnt move, so thats why i applied scaling there.

    but yes, i can scale both mouse and gamepad separately for some values like you advising and then have more reasonable values in FL. and im going to do it ;)
     
    gaborkb likes this.
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Yes, I think the FL should have reasonable values, and it's up to you to set up the input system to feed FL consistent values, accounting for the differences in the input devices.
     
  15. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    151
    I can confrim that there is a huge difference in speed of camera movement between old and new input system.
    Had to tone speed down a lot to get similar results (enclosed).

    I use same settings in Input System as Escuriak: Value, Vector2, Delta [Mouse].

    Values from Input action I can se in "Input Axis Value" in camera component are much higher than in old Input system and never decimal. Somewhere between -20 to 20.
     

    Attached Files:

    Last edited: Jul 24, 2020
    mohammdzencrsz and xshadowmintx like this.
  16. mohammdzencrsz

    mohammdzencrsz

    Joined:
    Aug 11, 2020
    Posts:
    1
    did anyone found a solution ı have the same problem too
     
  17. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    You can set up the new input system to scale the values it generates, so you can make it consistent with the old input system.
     
  18. urilache

    urilache

    Joined:
    Nov 23, 2013
    Posts:
    7
    This might be explained by the fact that speed is divided by time
    float speed = input / deltaTime;​
    This division looks very strange.

    In my case, the smart update method of CinemachineBrain updates in FixedUpdate and creates undesirable side effects
    • at low FPS (30 frames) it is rotating very fast
    • at high FPS(150 frames) it is barely rotating
    @Gregoryl do you have any input on how I can fix this?

    I'm using CinemachineFreeLook with CinemachineInputProvider from Cinemachine v2.6.9.
     
  19. patbaril

    patbaril

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    16
    Hello @urilache
    Using Cinemachine 2.6.9, we setup a gamepad with the new input system and hooked it to a Cinemachine Freelook camera and we are not seeing the behavior you are currently experiencing. Even if we change the game FPS, we ahve constant behavior. Even changing the Update Method give us constant behavior.

    Could you sent screenshot of you Cinemachine Freelook inspector so we can have a look at it?

    Thank you
     
  20. urilache

    urilache

    Joined:
    Nov 23, 2013
    Posts:
    7
    Attached is the setup I used for the Camera.
    Please note that the issue happens when using the mouse to rotate the camera (sorry, missed adding this info previously). Gamepad does not present this issue.

    Thank you for looking into this issue.
     

    Attached Files:

  21. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    189
    Hello Urilache :)

    Thanks for the reply. We managed to reproduce your issue on our side with what you provided. The team is looking at it.

    Thank you
     
    urilache likes this.
  22. urilache

    urilache

    Joined:
    Nov 23, 2013
    Posts:
    7
    Hello,

    Have you managed to find a solution to this issue?

    Thank you.
     
  23. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Yes we found a solution. The problem happens only for vcams that are being updated in FixedUpdate. The fix will be in the next release of CM.