Super keyword

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Super keyword

In GDScript, super() is used to call a parent function. For example:

class_name Pokemon

var name := ""

func attack() -> void:
  print(name + " attacked!")

A subclass can then use super() to call the parent attack:

class_name Pikachu extends Pokemon

func attack() -> void:
  print(name + " used Thunder Shock!")
  super()

This would result in "... attacked!" appearing after "... used Thunder Shock!".

super can also pass arguments. This is especially useful when overriding _init():

class_name Pokemon

var name := ""

func _init(initial_name: String) -> void:
  name = initial_name

The subclass then can use super() to fill those initial values:

class_name Pikachu extends Pokemon

func _init() -> void:
  super("Pikachu")

Note that contrary to every other method, _init() does not require the same arguments between parents and children classes when overriding it.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!