# AR Button kickoff function

**URL:** <https://forum.babylonjs.com/t/ar-button-kickoff-function/40123>\
**Category:** Questions\
**Created:** [April 23, 2023, 6:36am UTC](https://forum.babylonjs.com/t/ar-button-kickoff-function/40123 "2023-04-23T06:36:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calsa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/calsa/32/4330_2.png) [@Calsa](https://forum.babylonjs.com/u/Calsa)\
**Post date:** [April 23, 2023, 6:36am UTC](https://forum.babylonjs.com/t/ar-button-kickoff-function/40123/1 "2023-04-23T06:36:58Z")

</div>

When you push the goggles button on mobiles to enter AR, what function(s) fire to kick the whole show off?

I want to move that functionality elsewhere and get rid of the default button as a simple icon swap that the XR class lets you do is not going to do it. I did not see _the_ startup function assigned to its onclick.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 24, 2023, 1:02pm UTC](https://forum.babylonjs.com/t/ar-button-kickoff-function/40123/2 "2023-04-24T13:02:56Z")

</div>

cc @RaananW

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 24, 2023, 1:13pm UTC](https://forum.babylonjs.com/t/ar-button-kickoff-function/40123/3 "2023-04-24T13:13:31Z")

</div>

The function executed is the enterXRAsync of the experience helper:

[Babylon.js/webXREnterExitUI.ts at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/XR/webXREnterExitUI.ts#L218)

You can technically run the entire process yourself, but using the helper is simpler.

---

<div class="post-metadata">

**Author:** ![Calsa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/calsa/32/4330_2.png) [@Calsa](https://forum.babylonjs.com/u/Calsa)\
**Post date:** [April 26, 2023, 4:02am UTC](https://forum.babylonjs.com/t/ar-button-kickoff-function/40123/5 "2023-04-26T04:02:18Z")

</div>

Thanks, don’t know how I missed that in the code when searching.
