I Keep Getting An Error And I Don't Know Why

4.2.2 Godot Version

I’m Trying To Make A Camera Move With The Mouse For A Player But It Isn’t Working And I Don’t Know Why, It Keeps Giving Me The Error ‘Nonexistence function ‘rotation_y’ in base ‘Node3D’.’

extends CharacterBody3D

const SPEED = 5.0
const JUMP_VELOCITY = 4.5
const SENSITIVITY = 0.03

Get the gravity from the project settings to be synced with RigidBody nodes.

var gravity = 9.8

@onready var head = $Head
@onready var camera = $Head/Camera3D

func _ready():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED

func _unhandled_input(event):
if event is InputEventMouseMotion:
head.rotation_y (-event.relative.x * SENSITIVITY)
camera.rotation_x(-event.relative.y * SENSITIVITY)

The function is rotate_y, not rotation_y. Check the docs.