Godot Version
v4.5.stable.flathub [876b29033]
Question
Hey, new Godot user here. I have used a couple tutorials to get a little 3D block game going (mostly the LegionGames minecraft series). I have a background in programming, but there is a lot of stuff specific to games that is going over my head right now.
In order to teach myself better I didn’t follow the tutorials a 100% but introduced variations so I couldn’t just copy+paste stuff and had to really understand. Now my mouse-driven camera rotation is messed up in a creative way.
In short, this is what the problem looks like:

For this test, I just dragged the mouse forward to look up. No movement or anything else. It seems to be hitting a weird boundary.
I want full, fluid rotation with no clamping because I made it space-themed and my character is floating in space.
It seems to be a transform issue or some basic math I don’t get with 3D rotation. I tried many example of rotation transforms but every single one of them gave the swaying / unraveling motion of getting the axis order wrong, but… in every order. I copied word for word the rotation stuff from different tutorials to figure it out… to no effect. In the end, the only version that works only uses the rotation prop I know it’s bad, nothing else works! not the official doc examples either!
scripts/player.gd assigned to CharacterBody3D node
const MOUSE_SENSITIVITY = 0.005
# more code ...
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
rotation.y -= event.relative.x * MOUSE_SENSITIVITY
rotation.x -= event.relative.y * MOUSE_SENSITIVITY
It seems absurd to me that directly copying examples produces vastly different outcomes, with the transforms failing altogether. My best guess is that I might be handling movement wrong, as it is the only other place in the entire project where I deal with transforms and positioning stuff.
same script
const THRUST_SPEED = 0.05
# more code ...
var horizontal_input: Vector2 = Input.get_vector("left", "right", "forward", "backward")
var vertical_input: float = Input.get_axis("down", "up")
var direction: Vector3 = (transform.basis * Vector3(horizontal_input.x, vertical_input, horizontal_input.y)).normalized()
if direction:
velocity += direction * THRUST_SPEED
Is anything obviously wrong to someone? A basic misunderstanding somewhere? Tell me if there are other bits of code or setup that should be shared / are relevant.
Thanks!

