Polarith AI
1.8

◆ FindGameObjectsWithLayer() [2/2]

static GameObject [] FindGameObjectsWithLayer ( string  layerName)
static

Returns all active loaded objects with the layer having the specified layerName .

It will return no assets (meshes, textures, prefabs, ...) or inactive objects. Please note that this function is very slow. It is not recommended to use this function every frame. In most cases you can use the singleton pattern instead.

Parameters
layerNameThe layer (name) of the object to find.
Returns
The array of objects found matching the layer specified.
Imprint