Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Gramps | |
Old Version | Published before Godot 3 was released. |
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.