Godot Version
4.5.1 stable
Question
sorry if this was asked before .. im new here
In fps/tps camera tutorials, you should rotate only the camera (on X axis) and whole player (on Y axis) based on how much mouse moved on screen (screen_realtive).
Some tutorials (like brackeys “How to make 3D Games in Godot” tutorial) say that you must reset the basis (rotation & other things) to zero before executing the actual rotation code line (rotate_x & rotate_y) and some (well, they are not few tbh) say the opposite BECAUSE IT CAUSES JITTERNESS ON LOW SPEC PCS and that its a bad code habit. so .. is transform.basis = Basis() bad or good? and if its bad, whats the ultimate solution ?
brackeys 's proto-controller looking around code (from: “How to make 3D Games in Godot” yt vid) :
## Rotate us to look around.
## Base of controller rotates around y (left/right). Head rotates around x (up/down).
## Modifies look_rotation based on rot_input, then resets basis and rotates by look_rotation.
func rotate_look(rot_input : Vector2):
look_rotation.x -= rot_input.y * look_speed
look_rotation.x = clamp(look_rotation.x, deg_to_rad(-85), deg_to_rad(85))
look_rotation.y -= rot_input.x * look_speed
transform.basis = Basis() # <<<<<<<<<<<<<<<<<<< HERE
rotate_y(look_rotation.y)
head.transform.basis = Basis() # <<<<<<<<<<<<<< HERE
head.rotate_x(look_rotation.x)