Adding a Play button on a new scene


#1

I have been trying to make a main menu for my game but as soon as i think i got it it doesn’t work… i have looked for tutorials and help but no luck can anyone here help me out a bit???


#2

Can you share the project and the issue that you are having? Have you seen these tutorials? https://developer.playcanvas.com/en/tutorials/?tags=ui


#3

No i havent seen those before


#4

Is there a reason for using the legacy scripting system?


#5

It seems easier for me to use, the only problem i have is getting the scenes to change when you click play, i tried html but confused myself so i can here for help


#6

Legacy scripting is no longer supported by the PlayCanvas and all the tutorials are made with Scripts 2.0 which is not making learning any easier for you.

At a brief look from your project, the hud.js script is not attached to any entity in the scene so that is not being executed. If you continue going down the HTML route, you want to also add a button with a on click callback to change scenes.


#7

@yaustar ok i have an onclick button but does the callback work as like a file link?


#8

Here’s an example of creating a callback on a HTML button click: https://developer.playcanvas.com/en/tutorials/htmlcss-ui/


#9

Thank you for your help!