In the process of developing a first-person shooter game with three.js, I encountered an issue regarding loading the gun model. Using the clone() method on a player mesh to create different players and then adding the gun model to the player mesh through the add() method once it is loaded, results in the gun not being added due to the asynchronous nature of loading.
My goal is to delay execution until all models and resources have finished loading. Is there a way to pause the entire code execution until everything is fully loaded?