Invalid call. Nonexistent function 'update_ui_score' in base 'Nil'

4.2.1 Stable mono is what the version thing says

I’m a complete beginner and in my first project, following a tutorial for Godot 4.1, I ran into this error “Invalid call. Nonexistent function ‘update_ui_score’ in base ‘Nil’.” Below is the entire controller script where this is happening.

extends CharacterBody2D

@export var speed = 400.0
@export var jump_velocity = -650
@export var jump_count = 2
@export var gravity_multiplier = 2.0
@export var currentLevel:Node2D

var current_jumps = 0

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

var gravity = ProjectSettings.get_setting(“physics/2d/default_gravity”)

func _physics_process(delta):
apply_gravity(delta)
handle_jump()
handle_movement()

func apply_gravity(delta):
if not is_on_floor():
velocity.y += gravity * gravity_multiplier * delta

func handle_jump():
if is_on_floor(): current_jumps = 0

if Input.is_action_just_pressed("ui_accept"):
	if is_on_floor() or current_jumps < jump_count:
		velocity.y = jump_velocity
		current_jumps += 1

func handle_movement():
var direction = Input.get_axis(“ui_left”, “ui_right”)
if direction:
velocity.x = direction * speed
$GFX.flip_h = direction < 0
else:
velocity.x = move_toward(velocity.x, 0, speed)

move_and_slide()

func _on_area_2d_body_entered(body):
if body.is_in_group(“Collectible”):
currentLevel.update_ui_score(body.value)
body.Collect()

Edit: I just changed the ‘update_ui_score’ to ‘update_score’ to match other parts of the project, the same error comes up except with ‘update_score’

I solved it due to some directory code in another part, apparently dragging a directory once wasn’t enough