Quick answer: LoadThreadedGet blocks until the load finishes. Poll LoadThreadedGetStatus each frame and only call LoadThreadedGet once it reports Loaded.
Code uses ResourceLoader.LoadThreadedRequest then immediately LoadThreadedGet — and the game still hitches. The Get call waited for the background thread.
Request, Poll, Then Get
ResourceLoader.LoadThreadedRequest(_path);
public override void _Process(double delta)
{
var status = ResourceLoader.LoadThreadedGetStatus(_path);
if (status == ResourceLoader.ThreadLoadStatus.Loaded)
{
var res = ResourceLoader.LoadThreadedGet(_path);
OnLoaded(res);
SetProcess(false);
}
}
Calling LoadThreadedGet before the status is Loaded makes it a blocking wait — you lose the whole point of threaded loading.
Show Progress
LoadThreadedGetStatus has an out-progress parameter (a float array). Feed it to a loading bar so the wait is visible, not a freeze.
Handle Failure States
The status can also be Failed or InvalidResource. Branch on those — don’t assume the load always succeeds.
Verifying
Trigger a large resource load. The game keeps rendering at full frame rate; the loading bar advances; the resource appears when ready — no hitch.
“Threaded load = Request, poll status, Get only when Loaded. Get-before-Loaded is just a blocking load.”
Wrap this in a small ThreadedLoad helper with a callback — the request/poll/get dance is identical everywhere you stream content.