0 votes

I have a weird issue that seems to only affect Windows and not Linux when using Godot and threading. For example:

# Set up some variables
var thread = Thread.new()

func _ready():
    thread.start(self, "versionChecking", "Loading...")

func versionChecking(message):
    get_node("Loading Message").set_text(message)
    # Pull the game version
    var RESPONSE = http.getGameVersion()
    call_deferred(gameUpToDate())
    return RESPONSE

func gameUpToDate():
    var RESPONSE = thread.wait_to_finish()
    # Loading server data is done so end the loading screen
    global.goto_scene("res://src/menu.scn")

This works fine in Linux: pulls the data from the server and ends the process thus moving on to the menu. In Windows, however, it pulls the data but the following line prevents it from moving on:

var RESPONSE = thread.wait_to_finish()

If I comment this out in Windows, the function completes and the game moves on. I have no idea why this code works fine in Linux in a complete form and fails in Windows.

in Engine by (25 points)

1 Answer

+1 vote
Best answer

You should try call_deferred("gameUpToDate") instead, it works for me on Windows.

by (27,829 points)
selected by

Cheers for that! Going to implement it now and test it out.

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.