Reparent node through gdscript

Godot Version 4.1


func _on_object_intteracted(body):

I’m trying to reparent a node after interacting with an object. With this code it gives me Cannot call method ‘reparent’ on a null value. What am I doing wrong? Is there a better way? Thanks in advance.

Are you sure that the node paths are correct (be careful with case sensitivity)?

Yes it is. I’ve even tried different things but same error.

It doesn’t find any of the nodes:
Node not found “main/Path3D/PathFollow3D” (relative to “/root/main/Path3D/PathFollow3D”)
Node not found “main/player” (relative to “/root/main/Path3D/PathFollow3D”)


func _on_object_intteracted(body):