collectables is array of
load("*.tscn") scenes, it can't be
load loads scene, it will be
PackedScene that have
As for coin spawning function, I am still suggesting usage of
int variable as switcher because it is faster than checking types of scenes (your method is working, but it is not optimal).
var coin_type = randi()%collectibles.size()
var coin = collectibles[coin_type].instance()
if coin_type == 0:
coin.connect("coin_collected", self, "_on_coin_collected")
coin.connect("carrot_collected", self, "_on_carrot_collected")
This code is simply cleaner and faster.