system
1
|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
ATom 1 |
Is there a way to automatically inherit the parent function like _ready _process _enter_tree …in gdscript
Could you please specify a bit more? I am not sure what exactly you want to do.
Klagsam | 2019-12-14 09:03
In _ready() you don’t have to write ._ready(),
ATom 1 | 2019-12-14 09:49
system
2
|
|
|
 |
Reply From: |
SpkingR |
I think you must manually call the parent function otherwise the parent function behaviour will be overridden silently, a simple example like this:
class_name BaseNode
func parent_func():
print('parent function calls')
And the inherited class:
extends "res://classes/BaseNode.gd"
func parent_func():
.parent_func() # this line calls the parent function
print('child function calls')