So I've got a scene with an attached script. I've made a subclass of that script with some unique behaviours. Now I would like to create an instance of that scene but with the subclassed script attached. At the moment I'm doing:
var itemTemp : Item = load("res://item.tscn").instantiate() itemTemp.set_script(load("res://item-Potion.gd")) itemTemp.initPotion() potion = itemTemp as ItemPotion
But I've got a bug and I feel like I'm probably not doing this step properly.
I want to use the exact same scene as item but item-Potion.gd inherits from item.gd and just adds some attributes and functions.
Thanks for any help