State change doesn't work as intended

Godot Version

4.2

I have a script that changes the player’s state, but it processes in the code but in other functions it doesn’t, it stays with the .IDLE process.

Here’s my code:

class_name Player
extends CharacterBody2D

@export var speed: float = 130
@export var acceleration: float = 15
@onready var sprite = $Sprite

enum PlayerStates { 
	IDLE, 
	WALKING, 
	RUNNING, 
	PAUSED 
}

var lookingAt = 1
var current_state = PlayerStates.IDLE

func change_state(state):
	current_state = state

func _physics_process(_delta: float) -> void:
	if current_state == PlayerStates.PAUSED: return
	var direction: Vector2 = Input.get_vector("left", "right", "up", "down")
	
	velocity.x = move_toward(velocity.x, speed * direction.x, acceleration)
	velocity.y = move_toward(velocity.y, speed * direction.y, acceleration)
	
	move_and_slide()	

func _input(event):
	if current_state == PlayerStates.PAUSED: return
	var isPressed = Input.get_vector("left", "right", "up", "down")
	
	if isPressed == Vector2.ZERO:
		sprite.stop()
	
	if event.is_action_pressed("up"):
		sprite.play("walk up")
	elif event.is_action_pressed("down"):
		sprite.play("walk down")
	elif event.is_action_pressed("left"):
		if lookingAt == 1:
			sprite.flip_h = true
			lookingAt = -1
			
		sprite.play("walk  horizontal")
	elif event.is_action_pressed("right"):
		if lookingAt == -1:
			sprite.flip_h = false
			lookingAt = 1
			
		sprite.play("walk  horizontal")

And here’s the code for chaging the state in another node:

extends Area2D

signal playerEcounteredBattle

@export var base_chance := 150
@export var min_chance := 10

var player = Player.new()
var hasPlayerFoundABattle := false

@onready var timer = $Timer

func _on_body_entered(_body):
	if hasPlayerFoundABattle == true: return
	var random_chance = randi_range(0, base_chance)
	
	if random_chance > min_chance: return
	
	timer.start()
	Engine.time_scale = 0.5
	get_tree().call_group("Encounter Block", "disable")
	player.change_state(player.PlayerStates.PAUSED)
	

func disable():
	hasPlayerFoundABattle = true


func _on_timer_timeout():
	get_tree().change_scene_to_file("res://scenes/battle.tscn")

I managed to fix it, i was instantiating another player and not getting the current one.