Unable to call onPointerClickObservable function on GUI

Can someone please explain why this is not working: Babylon.js Playground

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

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

Great explanation: When (and why) you should use ES6 arrow functions — and when you shouldn’t

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

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!