0 votes

Hello! I can't instance scene in thread because thread doesn't return instance and i can't add scene as node child.

What can I do to instance scene in thread?

func _process(_delta)
    if get_node_or_null('Props') == null:
        var thread = Thread.new()
        var instance = props.instance()
        add_child(instance)
        for i in $Props/Scatter3D.get_children():
            if i.is_in_group('prop'):
                if i.get('data'):
                    if props_data.has(get_path_to(i)):
                        i.data = props_data[get_path_to(i)]
Godot version 3.4.stable
in Engine by (63 points)

You are only creating a thread not using it from the code you posted.

https://docs.godotengine.org/en/stable/tutorials/threads/using_multiple_threads.html

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.