Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | imekon |
I have a simple class hierarchy:
class Actor:
var x
var y
var z
func _init():
x = 0
y = 0
z = 0
class Player extends Actor:
var gender
func _init():
gender = 0
At the moment this is in the main scene for my project. What I want to do is put actor in Actor.gd and player in Player.gd, what I can’t figure out is how to?
I can put the class Actor in Actor.gd but it falls apart when I put Player in Player.gd. Even if Player.gd starts with
extends "res://actor.gd"
I get an error about unknown class Actor. Is this just not possible with GDscript?