PlayCanvas UI buttons are not working in WebAR mode

I am trying to animate my spawned 3D character with the click of a button placed inside a 2d screen(screen space). But once I enter the AR mode, the button stops interacting.
How can I solve this issue?? I don’t want to use HTML buttons and also I don’t want to keep them in 3D space.

There’s an known issue for this: WebXR AR screen space UI input doesn't register touches correctly · Issue #4776 · playcanvas/engine · GitHub

There’s a fix in progress that I’m going through testing with but there is a workaround that you can do in the mean time that is mentioned here: WebXR AR screen space UI input doesn't register touches correctly · Issue #4776 · playcanvas/engine · GitHub

Thanks for the reply, ill look into it immediately

I couldn’t able to figure it out, can u help me, with how to use the function that u mentioned and where to call it?

And currently, I am using the following script for ar

var XrBasic = pc.createScript('xrBasic');

// entity with button element
XrBasic.attributes.add('button', {
    type: 'entity'

XrBasic.attributes.add('availableAr', {
    type: 'entity'

XrBasic.attributes.add('availableHitTest', {
    type: 'entity'

XrBasic.attributes.add('moveAround', {
    type: 'entity'

XrBasic.attributes.add('controls', {
    type: 'entity'

// entity with camera component
XrBasic.attributes.add('cameraEntity', {
    type: 'entity'

XrBasic.prototype.initialize = function() {    
    // click button
    this.button.element.on('click', function() {
        // check support
        if ( {
            // start session
    }, this);'available:' + pc.XRTYPE_AR, function(available) { = &&;
    }, this);'start', function() {
        this.button.enabled = false;
        this.moveAround.enabled = true;
    }, this);'hitTestAvailable', function() {
        this.moveAround.enabled = false;
        this.controls.enabled = true && ! this.availableHitTest.enabled;
    }, this);'end', function() {
        this.button.enabled = true;
        this.controls.enabled = false;
    }, this); = &&;
    this.availableAr.enabled = ! || !;
    this.availableHitTest.enabled = ! || ! || !;

Am I supposed to call the function somewhere inside the above script??

This is not yet formally released but you can see how that workaround for the UI buttons is applied: