The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

I'm using a script to extend the capabilities of the "AnimatedSprite" node so I can do things like choose special durations to specific frames, or signal when a certain frame of a certain animation is reached. I'll refer to the scripts that defines those methods and signals "". I also would like to implement in a script attached to the AnimatedSprite node the animations for each individual sprite (player, enemy1, enemy2, etc.), using the methods defined in

How can I make so that some AnimatedSprite nodes inherit the methods from my, while still having a specific script attached to them (e.g.:,, etc.)? Can I "extends" or something like that? Or maybe define a new custom node that extends AnimatedSprite and adds my custom methods, and then extend my custom node on the individual sprites?

Thank you :)

in Engine by (22 points)

1 Answer

+6 votes
Best answer

Sure, you just extend by the path

extends "res://path/to/"

func _ready():

KidsCanCode did a tutorial on inheritance in Godot 3.0 earlier this year.

by (94 points)
selected by
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.