# Unable to call onPointerClickObservable function on GUI

**URL:** <https://forum.babylonjs.com/t/unable-to-call-onpointerclickobservable-function-on-gui/4973>\
**Category:** Questions\
**Created:** [August 8, 2019, 12:22am UTC](https://forum.babylonjs.com/t/unable-to-call-onpointerclickobservable-function-on-gui/4973 "2019-08-08T00:22:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![i73](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/i73/32/3167_2.png) [@i73](https://forum.babylonjs.com/u/i73)\
**Post date:** [August 8, 2019, 12:22am UTC](https://forum.babylonjs.com/t/unable-to-call-onpointerclickobservable-function-on-gui/4973/1 "2019-08-08T00:22:37Z")

</div>

Can someone please explain why this is not working: [Babylon.js Playground](https://playground.babylonjs.com/#K1E17G)

I can’t seem to register my clicks and when I do it’s not registering the function.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 8, 2019, 12:41am UTC](https://forum.babylonjs.com/t/unable-to-call-onpointerclickobservable-function-on-gui/4973/2 "2019-08-08T00:41:23Z")

</div>

Just a Javascript issue here, you need to use an arrow not just a function to ensure the “this” is what you think: [https://playground.babylonjs.com/#K1E17G#1](https://playground.babylonjs.com/#K1E17G#1)

Great explanation: [When (and why) you should use ES6 arrow functions — and when you shouldn’t](https://www.freecodecamp.org/news/when-and-why-you-should-use-es6-arrow-functions-and-when-you-shouldnt-3d851d7f0b26/)

You could also bind your function to the current scope upon creation but arrow might be easier.

---

<div class="post-metadata">

**Author:** ![i73](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/i73/32/3167_2.png) [@i73](https://forum.babylonjs.com/u/i73)\
**Post date:** [August 8, 2019, 2:05am UTC](https://forum.babylonjs.com/t/unable-to-call-onpointerclickobservable-function-on-gui/4973/3 "2019-08-08T02:05:35Z")

</div>

Oh, I totally thought that was bound through the action, but I see it acts as a sort of lambda with your explanation. Thank you so much Sebavan!
