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.

Question Can someone point me out to a tutorial showing how to use cinemachine with the new input system

Discussion in 'Cinemachine' started by dorusoftware, Nov 2, 2021.

  1. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    I've found this tutorial



    which doesn't work anymore, the camera is not moving smoothly like in the video. Is accelerating and decelerating very strangely. hard to explain. There is one dude in the comments that say it have the same issue so I'm not the only one.

    Something must have been changed behind the scene and I really don't know how to find out what is it and how to fix it.

    Maybe there is somewhere some info or tutorial on how to use the mouse to use the freelook camera.

    I'm really feed up with this unity policy of create a lot of complex systems and then leaving the user to figure out how to make them work together. write some simple steps to show how this works with essential parts of the engine like the input. Who created this system knows this more than anyone, why leave this job of showing how it works to someone on youtube who will most of the time guess how to do it and will provide hacked solutions that doesn't follow good practices.

    If you already write or created this info can someone sow me where it is. I cant seem to find it.
     
    Bonesplitter likes this.
  2. Pietrofonix

    Pietrofonix

    Joined:
    Aug 1, 2020
    Posts:
    44
    Same problem here, before Unity 2021.2.0f1 the cinemachine worked perfectly, now when i move the camera with the mouse (Delta mouse in the new Input System) there is stuttering, the camera is not smooth anymore
     
  3. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    I've "fixed" this in Edit - Project Settings - Input System Package

    then changing at the top from Fixed update to Dynamic update.

    I say "fixed" because while cinemachine works again for controlling the camera with the mouse Probably and most likely using dynamic update instead of fixed will mess some other stuff I have no idea about till I go head on into it and lose days and weeks to figure it out.
     
  4. fero_gg

    fero_gg

    Joined:
    Sep 9, 2019
    Posts:
    6
    Same problem here with aiming using Cinemachine (tried with and without the new Cinemachine input module with no luck). Switch to gamepad and it's smooth as anything so it's just related to mouse/pointer delta in some way.
    The above suggestion fixed the mouse movement (which was literally unusable like it was only updating every 2-3 seconds). Switching to dynamic update fixes it but the look/aiming but now I can't shoot, reload etc there is massive delays with these instead!!
    Really hope they fix this soon. Unity 2021.2.4f1 (switching to unity 2020 it's fine but I wanted the URP updates!!)
     
  5. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    77
    Hello :)

    I agree there is some work to improve the workflow Cinemachine / New Input system. Working with both should be less painful than it is right now. Feel free to share any pain you encounter.

    We are looking into this issue. Looks like when input package is in fixed update CinemachineInputProvider does not get all the values of mouse delta. We know were is the issue. We are checking how we can fix it.

    Can't promise for a fix date but we are looking into it.

    Thank you all for the feedback.
     
  6. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    hopefully this will get fixed soon :) at least I know now I'm not crazy since it worked fine before
     
  7. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    So I've installed the [2.9.0-pre.6] - 2022-01-12 version of cinemachine because there is a note there about

    Code (CSharp):
    1. Bugfix: Input system should be read only once per render frame.
    but this doesn't be the fix to this issue.

    I've downloaded unity 2021.2.11f1 and I've installed the unity Third Person controller, the one that is created by unity.

    Is unusable, the camera is broken.

    Frankly I would be ashamed to publish something that doesn't work. This is not a professional thing to do people.
     
  8. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    77
    Hello dorusoftware,

    This is not a fix for this bug. The issue comes from the input system package. There is nothing we can do on cinemachine.

    It is fixed with 1.3 version of the input system. If you want to stay on 1.2 (Default installed with 2021.2) the way around is changing the input handling in the settings (Edit - Project Settings - Input System Package) from fixed update to dynamic update.

    Let us know if this helps.
     
    Gregoryl likes this.
  9. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    I have the 1.3 version of the input system as you can see in the image

    I have a logitech gaming mouse where you can increase the precision of the mouse movement in games. On Low mode of this mouse both "dynamic" and "fixed" input modes are jerky. If I switch the mouse mode to Hi, and use "fixed" the camera movement is completely broken.

    This shows that mouse data/movement is not handled as it should by unity, cinemachine or the input system.

    Now I've included this logitech mouse gaming variable, but for reference all games that I have, they play fine with this mouse, and increasing the mouse from Low to High works as it should. (for example in Apex legends the mouse is more precise) Also it works on unity powered games just fine.

    I've downloaded unreal 4.27.2 and create a default third person project and the movement of the camera is perfect. Both in the unreal editor and when building the game the mouse works as it should and is smooth as butter.

    Getting back to unity, this is something related with a combination of cinemachine and the new input system. Who is to blame I don't know. Is not that the mouse use is broken in unity in general. In this case something is not right.

    You can test this by creating an empty URP project then adding the stater third party controller and hit play. Annotation 2022-02-18 191301.png
     
  10. Bonesplitter

    Bonesplitter

    Joined:
    Feb 19, 2018
    Posts:
    2
    I have exactly the same situation!
    With the mouse Logitech G604, and with games Apex + Genshin Impact, and with the Unreal engine.
     
  11. leeharris_unity

    leeharris_unity

    Joined:
    Jan 12, 2020
    Posts:
    38
    I too have had numerous difficulties getting Cinemachine to play nice with the new Input System. Changing from Max Speed to Input Gain on the speed setting option for each axis of my free look cameras has ultimately helped smooth things out, but getting the 'correct' speed/accel time/decel time for a particular orbit distance has been a real trial and error process, with the wrong values leading to jittery diagonal movement (i.e. when both axis are changing in the same frame). I'm still back on CM 2.7.8, though, since upgrading beyond that seems to introduce jitter again, though possibly just needs me to search for a new set of ideal speed settings again. It does make me worry a little what future end users with varying mice will end up experiencing.
     
  12. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    77
    Looking at your issue. I can't reproduce it so I will need some more infos. Could you try setting up a new project without the Input system package.
    • Download cinemachine.
    • install the sample.
    • Open 3rdPersonWithAimMode.
    Do you have the same lag problem?

    Let us know.
     
  13. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    77
    Could you share your settings. If you could do a recording (Gif or video) of what you had with 2.8?
     
  14. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    Can't upload video directly. here is the video inside a zip file. hope it works

    first is your re
     

    Attached Files:

  15. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    first is your request which works and no surprise there as I've tested the cinemachine with the old input in the past and worked fine

    second and third is cinemachine and new input system not working. last is unreal which works fine. all that motion blur in the last example is not visible when playing directly not sure why the video show up like that. but it works same as first example in unity. (the cinemachine control scheme in the first example is different but the smooth is the same)
     
  16. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    forgot to add one important thing. After I've created a new project and imported the starter assets third person controller I've hit play and it worked fine (with new input and cinemachine and fixed input and all) I was surprised and I've opened the project settings to check if the new input was enabled. It was and was on fixed update. I've hit play and everything was broken.

    Sadly I was not recording at the time.

    Opening and closing the project options had no other result. No change, still broken.
     
  17. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    150
    Unity is just more and more broken, 2 months and no reply from staff. If you plan to build a game in 12 months be ready to add extra 6+ months for diagnosing and fixing their bugs, terrible game engine.
     
  18. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    I didn't verified, but it appears they have updated the starter assets to use dynamic update. that was about it. and they not even tried to explain what is the difference between the two modes. fixed and dynamic.

    and I've changed this already to dynamic update before they added this update and the issue was less noticeable but still there. so not fixed just less annoying. already said in different threads about this and the devs knew.

    and then you open the unreal 5 complete game and the mouse works as it should had worked and how I expected to work.

    and on top of everything it doesn't even explain why for one time the starter assets works perfect with fixed update (like in unreal, smooth as butter) then you hit play again and is broken.

    so no two months, what about never?

    there is an issue between cinemachine and the new input system which appears after the second time you hit play in the editor. and then is broken for ever.

    and people that say is fixed by switching to dynamic update never actually played a game with a mouse that works as it should work.
     
  19. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    150
    That is an overall problem, newcomers don't know how things worked well before and they just accept new broken things as they are.

    Unity knows this and they don't care about complaints. Newcomers don't complain (majority), experienced users who complain are ignored and big studios fix issues by themselves.

    They are just adding more features while performance gets worse and worse, they break many things, complete mess out of the game engine. I'm sorry that I didn't start with Unreal Engine and that I'm stuck with this mess.

    To get an idea of their ignorance:
    There was a bug that caused huge crashes on iOS (disaster), I reported it and they just didn't want to do anything about it. They fixed it around a half year later and what I hear now, they again introduced it in the latest Unity versions.

    I reported huge rendering spikes that they introduced in later Unity versions with proofs and the whole project. No single reply for a year.

    For any major issues, they just say that it is an issue on your side, only if you press them with proof, and when they can't lie anymore they will admit that they made changes that caused issues.

    And their QA - Bug report support, most of them in initial level are students from my experience and they sound like they installed Unity a day before. Yes, simple bug reports will get fixed relatively fast, but complex serious ones, good luck with that.
     
    Last edited: Apr 30, 2022
  20. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    unreal made big steps in the last two years. while I've spent my time trying to come up with solutions to issues that sadly I have no knowledge how to fix. meanwhile unreal added a lot of stuff that helped what I was trying to do. like the control rig, hair, shared skeleton animation and on and on.

    I didn't knew about it.

    For some stupid reason that I still can't understand I didn't checked unreal for the most part of 2020 and 2021. Instead I've tried to make this broken bike work. Literally ended in a swamp when the editor will freeze for 10 minutes at the time trying to write and read fragmented "artefacts" files from disk. Lost months to find the solution. First didn't knew what was, then read the forums, trying everything posted there, then one day by pure luck found out that those those small files will get heavily fragmented and the disk can't keep up with the read write request.

    And then I've managed to make the project work again after three months. And I was burned out. And had enough.

    Fortunately looks like unreal works and does only the things I've thrown at it. We will see.
     
  21. antoinecharton

    antoinecharton

    Unity Technologies

    Joined:
    Jul 22, 2020
    Posts:
    77
    Hey,

    So the issue is fixed but it will be released later (My bad there was a mishap in what I said earlier). If you are using cinemachine it still works with the update mode set to dynamic update.

    If you are courageous and want to use fixed update the fix is available on the main branch of the input system package.
    https://github.com/Unity-Technologies/InputSystem

    Let us know if this helps :)
     
  22. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    680
    Thank You. I will wait for the official release because I'm not so good with github. I will test and write here if the issue was resolved.
     
unityunity