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
Prior to 4.1, I was able to start a thread from a Node that ran a member function:
extendsNodevar_thread: Thread=Thread.new()
func_ready():
_thread.start(_run_thread)
func_run_thread(_userdata) ->void:
# do workreturn
error:
E 0:00:01:0862 Node::get_script: Caller thread can't call this function in this node (/root/Game/InfiniteCubeTerrain). Use call_deferred() or call_thread_group() instead.
<C++ Error> Condition "!is_accessible_from_caller_thread()" is true. Returning: (Variant())
<C++ Source> scene\main\node.cpp:3540 @ Node::get_script()
This functionality remains broken after the threading changes in 4.1, which was not restored for my use case by #78000.
I cannot call Thread.set_thread_safety_checks_enabled(false) because my run function is prevented from starting.
It looks like this would work if I was using a Reference type, not a Node type:
akien-mga
changed the title
GDScript Can't start thread on Node member function
Misleading error when starting thread on Node member function with missing argument binding
Jul 2, 2023
Godot version
4.1.rc2
System information
Windows 10
Issue description
Prior to 4.1, I was able to start a thread from a Node that ran a member function:
error:
This functionality remains broken after the threading changes in 4.1, which was not restored for my use case by #78000.
I cannot call
Thread.set_thread_safety_checks_enabled(false)
because my run function is prevented from starting.It looks like this would work if I was using a Reference type, not a Node type:
https://github.com/godotengine/godot/blob/46424488edc341b65467ee7fd3ac423e4d49ad34/scene/main/node.cpp#L3539-L3542C2
Steps to reproduce
See above
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: