So i have some coins and when you touch them they have a reference to a "game manager" (aka a normal node with a script attached) and the code on the coin calls a function in this game manager. I used a tilemap scene collection to place the coins and I get an error whenever i touch the coins saying: "Attempt to call function 'add_point' in base 'null instance' on a null instance." but if i add a coin normally it works fine. How can i change it so i can access the script through the scene collection?
Game manager script:
`extends Node
var score = 0
func add_point():
score += 1
print(score)
`
coin script:
`extends Area2D
@onready var game_manager: Node = %GameManager
func _on_body_entered(body: Node2D) -> void:
game_manager.add_point()
queue_free()`