attach a clickable button to an imported mesh

Hello, I’m learning to use Babylonjs, I would like to attach a clickable button to a mesh that I have imported into my scene, how can I do this? Thanks in advance.
Thank you for your answer, but I already used this doc and it doesn’t work in my scene… When I click on the button sometimes the alert is displayed and other times not, I don’t understand why it does that

Welcome aboard!

I think this is what you are after:

Merci pour votre réponse, mais j’ai déjà utilisé cette doc et ça ne marche pas dans ma scène… Quand je clique sur le bouton parfois l’alerte s’affiche et d’autres fois non, je ne comprends pas pourquoi ça fait ça

Thank you for your answer, but I already used this doc and it doesn’t work in my scene… When I click on the button sometimes the alert is displayed and other times not, I don’t understand why it does that

It should always work.

Try to log a message in the browser console instead of displaying an alert, maybe there’s something with popups…

If you can repro in the Playground it will be easier for us to look for the problem.

1 Like