Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulioYagami |
So, I realised some Godot games have some scripts where extends SomeNode
doesn’t appear and I wanted to know what difference does it make when instancing those scripts (extend vs. doesn’t extend).
Now, another question related to that one: what if I use add_child()
with a script that doesn’t extend anything?
Example:
a.gd:
extends Node
var b = preload("res://b.gd").new()
var c = preload("res://c.gd").new()
func _ready():
add_child(b)
b.somefunc()
add_child(c)
c.somefunc()
b.gd:
func somefunc():
print("I'm b!")
c.gd:
extends Node
var somevar = 123
func somefunc():
print("I'm c!")
Sorry, probably for you English is difficult, but your question is not clear. Can you rewrite it? With more details?
BraindeadBZH | 2019-07-23 15:14
That’s rewritten.
JulioYagami | 2019-07-24 14:35