I cannot figure out how to properly use a thread for my required usage.
I am sending a POST http request from which I get a return value. The problem I am having currently is while this request is being sent the game holds and the loading cursor appears, which doesn't look great. I an animation to be playing while the request is returning but the game should not stop while this is happening. The basic outline of my code is below:
var data = get_node("node").get_data() \\this may be a number of things
get_node("/root/httpclient").talk_to_server(url, mode, data)
\\data is parsed then printed:
func talk_to_server(url, mode, data):
\\connect to server and retrieves data.
This works well for my needs but I want to use it in a thread so that the game doesn't stop while it is occurring. Also, so that I can play an animation while waiting for it to return.
I have tried a couple of examples of using threads but can't get it to work for myself.