Godot Version
4.2.2
Question
Just today, I learned that you can make a custom Resource class, and put argument in _init() function, the compiler will even ask for the parameter when using new() function.
The person showed me that explained it’s just something other language has, so he assumed that’s possible with GDScript and found the solution; but for me, who only ever wrote GDScript, I cannot grasp the logic behind it.
For me, virtual method is just something empty you write in the parent class so you can decide functionality later. Being able to add parameters is like…I don’t know, _ready() doesn’t do that, _physics_process(delta) doesn’t do that, so why does _init() do that?
The doc kind of just assumed I already know that, so it didn’t help.
I know there’s something fundamental I’m missing here, can someone explain it?
Are there some implications I should be looking out, like duplicate() doesn’t work as the doc mentioned, or this post said save and load would fail?
Thanks for reading.