I have a base class for Bullets, in this class there is a variable for bullet_speed.
BULLET_SPEED = speed
Then I have the childs of the base class
func _ready() -> void:
... SET BULLET SPEED HERE
The thing is, everything I tried for setting up the bulletspeed for this child doens't seems to change the parent bulletspeed (where the movement is handled).
What I tried (replace "... SET BULLET SPEED HERE") on the child's_ready func.
Calling the parent
Changing the variable direcly:
BULLET_SPEED = 500
... above code
(I don't know if I did the yield right tho)
The only thing that worked was setting a
_init(speed:float): BULLET_SPEED = speed on parent and setting the bullet_speed there, then calling the
_init().(500): pass, on the child.
I came from java and this is not a problem there as you inherits everything from the parent as being the same thing on the same instance.
Is the above situation the only way to access and change a parent variable? or i'm doing something wrong?