Need help with adding this line of code

Godot Version

v4.2.1.stable.official [b09f793f5]


So, im using this vid ( to learn how to start making 3D games, and after i put the code in the “Using the pitch pivot” part godot crashes when i run the scene.

Here’s my code right now.

extends RigidBody3D

var mouse_sensitivity :=0.001
var twist_input := 0.0
var pitch_input := 0.0

func _ready():

func _process(delta:float) → void:
var input:=Vector3.ZERO
input.x = Input.get_axis(“move_left”, “move_right”)
input.z= Input.get_axis(“move_forward”,“move_back”)
apply_central_force(input * 1200.0 * delta)
if Input.is_action_just_pressed(“ui_cancel”):

twist_input = 0.0
pitch_input = 0.0

func _unhandled_input(event: InputEvent):
if event is InputEventMouseMotion:
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED :
twist_input = - event.relative.x * mouse_sensitivity
pitch_input = - event.relative.y * mouse_sensitivity

I also get this message whenever i run the game .

Invalid set index "rotation_x (on base:‘Node3D’) with value of type ‘float’

Replace rotation_x with rotation.x.