Accesing a mess in the scene by name property

How can I acces a mess in the scene by the name property?

I have some messes with different names, something like:

Mesh {
   uuid: '374D56EE-03C8-4A07-B386-18B579BA7F08',
   name: 'post16', // <------this property 
   type: …

If I want to change its position, I can access it by index:

scene.children[2].position.x = 2

But I don’t know its position, just the name property. Can I access the children by its name?

Captura de pantalla 2021-11-21 a las 18.33.17

You can use the getObjectByName method of the Object3d. The scene is a Object3d itself so you can call it directly on the scene.

1 Like