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.
https://www.babylonjs-playground.com/#CY909H#2

Thank you,
DevRed

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 https://www.babylonjs-playground.com/#CY909H#3

1 Like

Thanks a lot !!! :smiley: