Skip to content

Instantly share code, notes, and snippets.

@rosskarchner
Created September 20, 2023 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosskarchner/86230a3eb0ef3764d2aee2e9701fd8e8 to your computer and use it in GitHub Desktop.
Save rosskarchner/86230a3eb0ef3764d2aee2e9701fd8e8 to your computer and use it in GitHub Desktop.
extends Node
class_name A
func name_func():
return "foo"
func say_hello():
name = name_func()
print("Hello " + name)
extends A
class_name B
func name_func():
return "bar"
extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
var test = B.new()
test.say_hello()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
@rosskarchner
Copy link
Author

When I run this (root node is a Node with node.gd as the script), it prints Hello bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment