Godot Version
Godot 4
Question
heres my code
extends Node3D
var parent = get_parent()
func _ready():
pass
func _process(delta):
print(parent)
this returns <Object#null>
but if i do it like this:
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var parent = get_parent()
print(parent)
it returns this:
watermelon:<Node3D#31071405353>
how do i get it to return that but establish the var outside of the functions