I wanna use the gui system but ı cant break this problem
let loadedGUI = await advancedTexture.parseFromSnippetAsync("#MMWSUI#5");
I dont use the await word bu if ı dont use await program is not work
if i can use await word .program is again shutdown
how can ı fixed
if (regexColor.exec(mesh.name)) {
mesh.actionManager = new ActionManager(scene);
mesh.actionManager.registerAction(
new ExecuteCodeAction(ActionManager.OnPickTrigger, () => {
let advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“GUI”, true, scene);
let loadedGUI = await advancedTexture.parseFromSnippetAsync(“D04P4Z”);
})
);
}
Did you flag your function with async?
like
var foo = async function() {
…
}
Really
my function already has async
problem is this
When I use asynchronous function (await ) the program does not run
export const stfu = async()=>{}
if your containing function cannot be async - you can try an IIFE. here is a working playground that works with both snippets you provided:
iife parseFromSnippetAsync | Babylon.js Playground (babylonjs.com)
I use every method I guess the problem is elsewhere
Hello @Knifepro just checking in if your question was answered