Open dluke opened 3 years ago
Hi @dluke !
Godot classes are not all refcounted, this is strange from a Python point of view where everything is supposed to be garbage collected.
So in Godot-Python you instantiate refcounted Godot classes with the traditional MyClass()
and non-refcounted ones with MyClass.new()
that makes explicit you are now responsible for freeing this object.
Regarding your NativeScript
issue, I'm able to instantiate a NativeScript
object by doing:
def test_instantiate_nativescript():
from godot import NativeScript
x = NativeScript()
Can you provide more informations to reproduce the issue ?
Having defined a Reference derived type and loaded the NativeScript resource, when using
.new()
godot-python tells meRefcounted Godot object must be created with NativeScript()
Indicating that the correct syntax is to call the class name i.e.Array()
but thenTypeError: 'godot.bindings.NativeScript' object is not callable
that doesn't work either.Is this a bug or am I doing it wrong?