get_node: (Node not found: "Player" (relative to "/root/Main").)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nonken

So i get the error above in the title in this script:

extends Node

var nmis = []
onready var playerNode = get_node("Player")
onready var playerStart  = get_node("PlayerStartPosition")

func  _ready():

func _process(_delta):
    nmis = $EnemyList.get_children()

I get the error on the two onready var lines (4,5) even though both nodes are in the same scene tree as children of Main. Heres my scene tree:

:bust_in_silhouette: Reply From: Beatrix

You Can Try

onready var playerNode = $Player