I have a problem where whenever I wish to delete something, the game will crash. I get this error:
Attempt to call function 'is_in_group' in base 'null instance' on a null instance.
It occurs at this line:
if rayCast.is_colliding() and rayCast.get_collider().is_in_group("Zombie"):
The code doing the "deleting" in question is this:
func disable_collisions():
if self.get_parent().has_node("HitboxComponent"):
var hitbox = self.get_parent().get_node("HitboxComponent")
if hitbox.get_child(0):
await get_tree().create_timer(1.0).timeout
get_parent_node_3d().queue_free()