Godot Version
4.5
Question
This is the code in one script:
extends Area2D
func _on_body_entered(body: Node2D) → void:
CheckpointManager.checkpoint_reached()
And this is the code inside my autoloaded script named “CheckpointManager”:
extends Node
func checkpoint_reached(position: Vector2):
printerr(“CHECKPOINT”)
Whenever the code is triggered I just get an error that says “Invalid call. Nonexistent function ‘checkpoint_reached’ in base ‘Area2D (checkpoint.gd)’.”
Iv’e also tried this:
extends Area2D
func _on_body_entered(body: Node2D) → void:
get_node(“/root/CheckpointManager”).checkpoint_reached()
Iv’e already tried doing this entire thing with signals, but the connect() function was getting an error despite everything i could find showing that i was dong it right