Although it works, it doesn’t seem the most practical way to do it. All those references to the parent node seem wrong and dependent on the structure of the tree of the project. Is there another way to do it?
You can export variable to set it up in editor rather than in code
export(NodePath) var char_nodepath
var char_node
func _ready():
char_node = get_node(char_nodepath)
func check_overlap():
if overlaps_body(char_node):
print("yesh!")
Now press on node that has this script attached and look in Inspector: you will see category named Script Variables with field named Char Nodepath. Click on field and press “assign”, then choose your Character/KinematicBody2D node.