- Edited
Hey all, I have a set of equipment I want to make for my game and realized that some inheritance would go a long way to making the system more maintainable. I've run into a bit of an issue, though. I have made my base scene, which also has a script with some properties in it and I want to put a method stub in there. Easy enough. The issue comes when I make a new inherited scene based off of my base scene. The scene stuff is fine, but Godot just copies over the script connection instead of creating a new script that extends the base scene's script which I feel would be much better inheritance. I found this older reddit post of someone who said they thought that was already a thing, and to be honest I thought it was, too. Is there some way to get Godot to do this? Is it a planned feature?
Example: Base.tscn Base_Script.gd
Potential content of Base_Script.gd
export(Color) var color
enum Equipment { SHOVEL, SWORD }
export(Equipment) var type
func _ready():
// Stuff here maybe
func stub_method():
// Logic to be overloaded (if that's possible?)
Shovel.tscn (the inherited scene, which works as expected) No Shovel.gd is made
Connected to Shovel.tscn would just be the Base_Script.gd which doesn't allow for proper script inheritance at all. I know I could just make my own script, which if that's what I gotta do I'll do it, but it just feels a little lack luster. Wanted to make sure I wasn't missing something first.