When my mob respawned he didnt get where's player

Godot Version

Godot 4.2.1

Question

func _physics_process(delta):
	var karakter_pozisyon = self.position
	var y_koordinati = karakter_pozisyon.y
	var x_koordinati = karakter_pozisyon.x
	print(y_koordinati)
	print(global.karakter_x," ",global.karakter_y)
	death()
	deal_with_damage()
	health_bar()
	move_and_slide()
	
	if not global.mob_alive:
		return
	if player_chase and global.mob_alive and global.player_alive:
		position += ((player.position - position).normalized()) * speed * delta
		$AnimatedSprite2D.play("walk")
	elif y_koordinati >= global.karakter_y:
		position += ((player.position - position).normalized()) * speed * delta
		$AnimatedSprite2D.play("walk")
		print("a")
	else:
		$AnimatedSprite2D.play("idle")


func _on_area_2d_body_entered(body):
	player = body
	player_chase = true



func _on_area_2d_body_exited(body):
	player = null
	player_chase = false
func enemy():
	pass

is problem my math or something in code? ( I just want to try but if player y > mob y it should follow but it isnt)

might want to use global_position, example: player.global_position.x > mob.global_position.x

I thought like that but I took print two of them thats bigger if correct but it didnt worked

this works for me., as i move sprite A in the editor, greater than changes to less than in the output window.

extends Sprite2D
func _process(delta):
	# find sprite named A
	var v_sprite : Sprite2D = get_parent().find_child("A")
	
	# greater or less than x of this sprite
	if(global_position.x > v_sprite.global_position.x):
		print("greater than")
	else:
		print("less than")