Issue with the input script

4.2.2

I’m setting up the input for the controller and mouse

func _input(event: InputEvent)  -> void:
	if event is InputEventMouseMotion:
		rotate_y(-event.relative.x, * Sensibility)
		head.rotate_x(-event.relative.y, * Sensibility)
		head.rotation.x = clamp(head.rotation.x, deg_to_rad(-70), deg_to_rad(70))

func process_move():
	
	if not is_on_floor():
		velocity += get_gravity() * delta
	
	input_axis = Input.get_vector("move_back", "move_forward",
			"move_left", "move_right")
	
		# Left Analog Stick
	var left_horz = Input.get_action_strength("left_stick_right") - Input.get_action_strength("left_stick_left")
	var left_vert = Input.get_action_strength("left_stick_up") - Input.get_action_strength("left_stick_down")
	var left_vec = Vector2(left_horz, left_vert)
	
	
	var direction := (transform.basis * Vector3(input_axis.x, 0, input_axis.y)).normalized()
	
	if direction:
		left_horz = velocity.x = direction.x, * current_speed
		left_vert = velocity.z = direction.z, * current_speed
	else: 
		velocity.x = 0
		velocity.z = 0

I keep getting this error on the code

Expected expression as the function argument (mouse)
Expected closing “)” after call arguments (mouse)
Expected end of statement after expression, found “(” instead (mouse)

Assignment is not allowed inside an expression (controller)

First, always post the entire code, makes everything easier

You’re multiplying Sensibility with nothing, u put a “,” between -event.relative.x and Sensibility


Again multiplying a variable with nothing, also you’re doing a double assignment here that doesn’t make any sense.


I strongly recommend you learn more about the basics of programming and syntax before try do any game.

1 Like