I’m wondering what code would replicate what the Playground Run button does.
For instance, clicking a button would restart the scene in exactly the same way.
I found various forum posts referencing createScene() and scene.dispose(), but my scene crashes when I call those functions.
Just curious if I should keep working with those options, or if there is a better way now to restart a scene.
I’m new to programming and Babylon.js, so I don’t fully understand how to implement the code you provided. As you’ll see in the PG, calling scene.dispose() freezes the scene. I’m not sure if that’s a successful first step or not
Also, hello @holger, and thanks for the link. I did read that post. The solution definitely seems to be there (just like with what @aWeirdo is providing), but I just don’t see it at my current level of understanding. The code makes sense, I guess I just don’t know where it all goes without a working example.
Perhaps with this discussion a functional PG can be made that demonstrates how this works for those with the same question in the future
Hi @Anderson34
I only have a couple minutes atm, so i can’t explain in detail.
Check out the html template on this doc page, maybe that helps you get a better understanding