Architecture & async calls

Hi,
I’m having some issues with architecture of my game:

  1. I need to place entities on heightmap derived map, I read the y coordinate from heightmap, aaand it’s not working, most likely because heightmap is not ready.
  2. The heightmap derived map has to be optimized (done in callback)

Now, is there any other option for rather than starting all the game loop after the the heightmap terrain is fully downloaded?

var ground = BABYLON.Mesh.CreateGroundFromHeightMap(“ground”, “textures/ground/heightMap.png”, 200, 200, 100, 0,10, scene, false);

The last parameter of CreateGroundFromHeightMap is a onReady callback that you can use to know that the mesh has been successfully created.

2 Likes