Wait for object loader

@MrBodean it sounds like you have more code involved here than what’s in your post, can you share something we can look at? If you have nested functions, they need to all use async await, or things just continue without waiting for requests to complete. fetch() will work the same way.

async function LoadImage () {
  const result = await loader.loadAsync(...);
  return result;
}
async function LoadModel () {
  const result = await loader.loadAsync(...);
  return result;
}

const image = await LoadImage();
const model = await LoadModel();
1 Like