Add searchbar to scene

Hi guys,

I have a scene with many different meshes in it. Now i want to implement a searchbar to look up certain meshes. For example I want to type in the name of a mesh and after pressing enter this mesh is highlighted.

Do you now if that’s possible? Is there a possibility to implement a searchbar?


Since Babylon.js is and extension to Javascript there are several ways to do it. For example
or use HTML for your own search bar.

All meshes in a scene can be found using

An individual (if named uniquely) mesh using


Great, that worked!
Now i want to start my search with the “enter”-button. But unfortunatly that wont work. Im using this code:

new BABYLON.ExecuteCodeAction(
trigger: BABYLON.ActionManager.OnKeyDownTrigger,
parameter: ‘+’
function () {…

With the + oder any other key it works fine. Maybe Babylon.js uses a different name? I tried “return” but that doesnt work either.
Any suggestions?

Remember to click with mouse pointer on scene before using keys. This PG Babylon.js Playground will give you names and codes for the key.