AR add button play animation

how to make button to play animation like this PlayCanvas | HTML5 Game Engine but i want to add a button on AR

here’s my project

@yaustar can you help me to solve this. what functions should be added to run the animation when pressing a button? :smile:

Hi @Dann,

To get you started with the Playcanvas UI, take a look at the following samples. The User Interface - Buttons tutorial in particular can be helpful for you:

Looks like you have a callback on the button press but all it does is set a property to true but that property is not used elsewhere.

From a quick look, it be easier to play the animation in the ui:playAnimation event callback instead.

1 Like

did you mean like this?

 button1.onclick = function (event) {'ui:playAnimation');
        var playanimation ='Character');'angry.glb');

can artoolkit use 2d screens?

Should be able to

thank you it work