-
i cannot pass the string to the AddResource method. even I tried to cast it to gd.StringName but still it was unsuccessful.
error:
even I've tried to make StringName var but there is no way to add string to it
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It doesn't look like the Godot Environment class has an I regards to
Note that for any godot reference types (including string names & classes), the zero value is not valid, ie. it is essentially The The reason why there's this awkward way to create |
Beta Was this translation helpful? Give feedback.
It doesn't look like the Godot Environment class has an
add_resource
method?https://docs.godotengine.org/en/4.2/classes/class_environment.html
I regards to
StringName
, this is a Godot defined reference type, it can be initialised via an availablegd.Context
. You can create agd.String
and call theStringName
method on it. The value will be valid for the lifetime of the context.Note that for any godot reference types (including string names & classes), the zero value is not valid, ie. it is essentially
nil
. So passinggd.Environment{}
does…