Invalid get index 'position' (on base: 'null instance'). Help FIx!

Godot Version

godot engine v4.1.3 stable official
Invalid get index ‘position’ (on base: ‘null instance’).

extends CharacterBody2D

@onready var player = get_parent().find_child(“player”)
@onready var sprite = $StartingUp

var direction : Vector2

func _ready():

func _process(_delta):
direction = player.position - position

if direction.x < 0:
	sprite.flip_h = true
	sprite.flip_h = false

func _physics_process(delta):
velocity = direction.normalized() * 40
move_and_collide(velocity * delta)

Well, apparently the player wasn’t found. Check if a node with this name really exists. Perhaps it’s not a child of the current node’s parent?
Or maybe the function _process is called before @onready is finished.

Try to use get_node.
If it doesn’t works, check if node player exists and your spell is corrent.