how to make button to play animation like this PlayCanvas | HTML5 Game Engine but i want to add a button on AR
@yaustar can you help me to solve this. what functions should be added to run the animation when pressing a button?
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) {
self.app.fire('ui:playAnimation');
var playanimation = this.app.root.findByName('Character');
playanimation.animation.play('angry.glb');
};
can artoolkit use 2d screens?
Should be able to
thank you it work