Hi,
I’m trying to retrieve the id of a button created on PlayCanvas in the build with my script, to be able to do an action on click, but I can’t, I don’t understand why.
Yeah for sure is that., so maybe i can’t do what i want.
In my project I wanted using an interface to let the user choose between two scenes.
For example:
-The scene with the blue cube
-Or the scene with the red cube
So my buttons in regular html would call the buttons in the playCanvas for the scene switch and then display the PlayCanvas with the corresponding scene.
But since the html is trigger at runetime maybe that is not possible because when the user chooses between the two scenes, the playcanvas is not yet generated
Sounds like you would have 3 scenes, a ‘hub’ scene, blue cube scene and red cube scene.
The hub scene would load first with the HTML buttons to allow the user to load either the blue or red cube scene based on something like localStorage or a URL param
What’s the reason? I’m still confused about the end result you are looking to achieve.
Even if you can’t use the hub scene to start with your project, you can still use it decide which ‘real’ scene to load with the cubes instead of having separate PlayCanvas builds