Godot Version
Godot v4.7
Question
Hi, is there a way to redefine a variable type in a child class?
Example: I would like to have a generic StateMachine and one crafted for the needs of my character extending the generic one.
I have two base class: StateMachine and State
and CharacterStateMachine extending StateMachine and CharacterState extending State.
in the StateMachine class, i defined a variable current_state of type State
var current_state: State
In the CharacterStateMachine, is it possible to redefine the current_state variable type with one that extends its initial type State (CharacterState in this example)?
I feel this is a bit weird and I donāt think this is possible. What would be a good way to handle this? am I thinking about this in a really weird way?


