I need help with an error in the script

Godot Version



“Hi, I’m new to Godot and this is my first time posting in a forum. I’m wondering how I can fix this error. The error message I get is ‘Attempt to call function ´is_colliding´ in base ´null instance´ on a null instance.’ I’ve been stuck on this error for about 3 hours today and couldn’t solve it. It would be a huge relief if someone could solve this problem.”

player_track_raycast is null. The node path in the declaration is incorrect as far as I can tell. You put “2D” at the end of the path but the node’s name doesn’t have “2D” at it’s end

Thanks for the tip, but this may sound stupid now, how and in which line can I fix it?

In your spike_shroom script:
@onready var player_track_raycast = ← make sure you add the correct node path here.
You can drag&drop the node into the code to get the node path.

1 Like

Thank you very much, now it works even though, as expected, more error messages came, the error is finally fixed and because of you, it has also become a good Monday.Good by.:blush:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.