v4.3.dev6.official [89850d553]

class_name Character
extends CharacterBody3D
class_name PlayerCharacter
extends Character

or

class_name CharacterState
extends RefCounted
class_name CharacterMoveState
extends CharacterState
class_name CharacterCrouchState
extends CharacterMoveState

Since when is this possible? I'm pretty sure this wasn't possible in 4.2 and earlier. You couldn't extend from something that already extended a non built-in class.

I hope this is not a bug, but a feature, because it is so useful and one more reason to use gdscript instead of C#.

EDIT: I don't understand this... I tested this in earlier version and it works. Is my brain somehow tricking me?

    trizZzle Since forever. It was already in v3, and probably even earlier. Most likely it was a feature of gdscript from its conception.
    Without this the whole extends thing wouldn't be too useful. I mean allowing only one level of class inheritance in an object oriented language would be... well... quite strange.

    When seeing the thread title I was afraid you discovered actual C++ style multiple inheritance, when a class can inherit from multiple super classes at once. Now that's some funky business. Imagine: class_name hypergoo extends Sprite2D, Node3D, EditorPlugin

      trizZzle

      You also can always do

      extends "res://path/to/base.gd"

        xyz Strange. This was my biggest gripe with gdscript. And I'm 100% sure I tried doing this multiple times before and I got error messages saying this wasn't possible. And yes, it didn't feel very useful and I was confused why it wasn't possible.

        Now I doubt my sanity...

        indicainkwell Uuh, didn't know that. But I prefer to not have string references if possible.

          trizZzle This was my biggest gripe with gdscript.

          My related gripe is that I can't extend a built-in class such as FileAccess and override a method. If I could have done that, it would have simplified an add-on that I wrote.

          trizZzle Now I doubt my sanity...

          Look at it from the bright side. You'll finally start using gdscript as intended 😃