How to delete a mesh which is add in the scene with a delete button

Hi Everyone,
How to delete a selected mesh added in the scene with the help of delete button? I have been trying for a while but is unable to figure out.

Please check out the sample here.

Thank you,

You can select a mesh with picking collisions (Picking Collisions - Babylon.js Documentation) and then inside delete button callback function check if any mesh is selected. If mesh is selected, call dispose method.
Here’s your modified example

1 Like

Thanks a lot !!! :smiley: