+5 votes
extends "cannon_base.gd"

# Override
func catch(avatar):
    # How can I call the base function from cannon_base?
in Engine by (29,038 points)

1 Answer

+20 votes
Best answer

From http://docs.godotengine.org/en/latest/reference/gdscript.html#referencing-functions:

To call a function in a base class (i.e. one extend-ed in your current class), prepend . to the function name:
.basefunc(args)

So it's

func catch(avatar):
    .catch(avatar)
by (924 points)
selected by

Beware the note on that docs page:

Default functions like init, and most notifications such as _entertree, exittree, process, _physicsprocess, etc. are called in all parent classes automatically. There is no need to call them explicitly when overloading them.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.