My character moves only to the left without me doing anything

My character moves by itself without me doing anything, I have already reviewed the movement code several times, I even tried trying other methods with the same function (moving the character) and they all continued with the same problem (The code worked in yes, but my character moves infinitely by itself)
I also installed and uninstalled versions of unity client to see if it could be solved by doing that but no

Do you think it could be a problem with the unity client? I am using version 2022 although in version 2021 and 2019 the same thing happened to me, could it be some configuration that I touched by accident? And if so, how do I return it to its original state?


Here is the code that I used


203125-screenshot-4.png

I suggest that you log out what the axis values are i.e. hor and ver (also please name them something better than hor, ver and dir which are meaningless abbreviations are almost always bad code).


You may find that they aren’t at exactly 0 when your hands are off the controls. Often controllers with axis controls are not perfect when centred (a lot deal with this in hardware but some don’t) so you may need to add in a dead zone to account for that.