Godot Version
4.3 stable Windows 11
Question
I’d like to be able to have builtin functions like _process(delta)
and _ready
in two scripts, even if one script extends from the other.
This is because I’m using a base script for every player, and then each variation of player will have its own script that extends from everything in the player script, in addition to its own code.
For example, I’d like to use the _process(delta)
function in some character scripts to flip the sprite based on direction - but not others in case I don’t want that for that character, but I can’t do that because I already use _process(delta)
to animate the UI in the universal player script.
One workaround I tried is this:
func _process(delta):
animate_UI()
if self.has_method("character_specific_function"):
character_specific_function()
But that didn’t work, as you can’t call a function from a script that your current script extends from… not even if you check for that function, apparently.
Is there a way to accomplish this? I’d really like to know. Any help is appreciated.