Hello,
How to get the script metadata and not the object metadata the script is attached to? Thanks
Long story:
A little exercise here, stopped by this.
I'm writing a simple script to be attached to an object. The script has metadaya "destroy": if "destroy" is on, the object is deleted (at the moment it just prints a message). So I've created the script and attached to the object. But when I run the project, this is the error I have:
deleteme.gd:5 @ _ready(): The object does not have any 'meta' values with the key 'destroy'.
The script is this one:
`extends Node
func _ready():
var destroy = self.get_meta("destroy")
if destroy:
print("nghea")
func _process(delta):
pass`
What am I doing wrong?
The aim was learning Godot in creating a generic script to be attached to any object and see how to reference that object inside the script.
Thanks in advance.