So I was following a tutorial for fps character controller script, mainly just for the camera movement, for a game jam and realized that the camera script when looking up and down the sensitivity is super high but looking left and right its perfectly fine even though both axis are using the same sensitivity value.
I tried removing delta but the problem still happens, and changing event.relative to event.screen_relative gives me a invalid get index an error for some reason
That should not be erroring.
Are you sure that is the code when using .screen_relative? You aren’t leaving anything out are you?
The error message is very strange. If I misspell screen_relative I do not get that error message.
Post the actual code that is creating that error.
What you are seeing is exactly what happens. Even if I copy paste it I still get the error. What I posted was the entire code. Not sure what else I can show that would help.
I checked the documentation for Godot v4.2 for you. The event_relative was not yet a part of InputEventMouseMotion. Unless you have a specific reason not to, you should update your project to the latest stable version.
The advice provided by @gertkeno is correct and supported by the official documentation which states:
Note:relative is automatically scaled according to the content scale factor, which is defined by the project’s stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using relative in a script that handles mouse aiming with the Input.MOUSE_MODE_CAPTURED mouse mode. To avoid this, use screen_relative instead.
Oh I see, in that case thank you for the input, but the reason I haven’t updated it is because I am working on a full fledged game and I didn’t want to deal with any potential errors that come stemming from things being changed, removed or updated to work in a different way. So I just kept this version. After I am done with it I shall update.
Soooooo I found the solution and apparently, the reason why my camera was wonky was because the Node3D in which I had the camera attached to was scaled very weirdly, and when I reset it it suddenly worked as intended.
I dont know why this was the case.
But i will keep gertkenos answer for future reference just incase