@TwistedTwigleg i've made sure the collision is working using the print() function. when i try to run that code the error message i get is: Invalid call. Nonexistent function 'instance' in base 'Nil'. (line 7), i tried using:
` onready var tileScene = preload("res://scenes/tile.tscn")
func _input(event: InputEvent) -> void:
if event is InputEvent:
if event.is_action_pressed("ui_select"):
print ("Spawning")
spawn()
func spawn():
var t = tileScene.instance()
add_child(t)`
and that worked, but when i try
` onready var tileScene = preload("res://scenes/tile.tscn")
func _on_CollisionPolygon_tree_entered():
print ("Spawning")
spawn()
func spawn():
var t = tileScene.instance()
add_child(t)`
that gave me the same error message