Polarith AI
1.8

◆ FindGameObjectsWithLayer() [1/2]

static GameObject [] FindGameObjectsWithLayer ( int  layer)
static

Returns all active loaded objects with the specified layer .

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
layerThe layer of the object to find.
Returns
The array of objects found matching the layer specified.
Imprint