You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help narrow it down I have created a minimal reproduction project as a Godot module. Not too much is going on, the main concern is this method right here:
It should be creating an instance of the ExampleCallableCustom which it does without issue for GDScript, but the deconstructor for it is called before C# can get its hands on it.
I added prints to the call method on the callableCustom, and constructors and contributors on both the callableCustom and refCounted.
C# Class
usingGodot;usingSystem;publicpartialclassc_sharp:Node2D{// Called when the node enters the scene tree for the first time.publicoverridevoid_Ready(){ExampleRefCountedexample_ref_coutned=newExampleRefCounted();Callableexample_callable=example_ref_coutned.GetExmapleCallable();example_callable.Call();}}
As explained in the C# differences documentation page, custom Callables are not supported in C#.
This means the only Callables that can be used in C# are the ones created using a method name and an Object instance, or Callables created from C#. It looks like you are using GDExtensions to create a custom Callable type, so that would fall into the unsupported scenario.
It looks like you are using GDExtensions to create a custom Callable type, so that would fall into the unsupported scenario.
All good if it's unsupported. I am not using gdExtension here though, this is as a core engine module. Not sure if it makes a difference either way though in this case.
Ah, custom Callables aren't supported even if they are implemented in the engine. For example CallableCustomBind and CallableCustomUnbind (the Callables you get when you use the bind and unbind methods) are also unsupported in C#.
Just to be clear, this is not intentional, it just hasn't been implemented yet.
Godot version
399c9dc
System information
Arch linux - 6.5.5-arch1-1, Godot 4.1.2 Mono custom build
Issue description
I discovered this issue while trying to find the cause of WeaselGames/godot_luaAPI#170.
To help narrow it down I have created a minimal reproduction project as a Godot module. Not too much is going on, the main concern is this method right here:
It should be creating an instance of the ExampleCallableCustom which it does without issue for GDScript, but the deconstructor for it is called before C# can get its hands on it.
I added prints to the call method on the callableCustom, and constructors and contributors on both the callableCustom and refCounted.
C# Class
GDScript Class
This is the output we get:
When C# does call the Callable.Call method we get this error which makes since seeing as the de constructor was called prior.
I am not much of a C# developer so I may be missing something. I'm also unsure but think it may be related to #76108
Steps to reproduce
Build godot 4.1 branch with https://github.com/Trey2k/cscallable and run the TestProject from within
Minimal reproduction project
https://github.com/Trey2k/cscallable
The text was updated successfully, but these errors were encountered: