Help Needed-Script not running

Hi. I am using Unity Pro & Unity Reflect. I have installed the Reflect package into Pro

It has been a number of years since I used c# and I haven’t used it with Unity. I have written the following script to filter metadata that comes in to Unity through Reflect. I have attached the script to a empty game object. I want the script to run when I go into playmode. Nothing happens. Any ideas would be really appreciated . See code below. I know I am missing something very simple.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Reflect;
public class FilterData: MonoBehaviour
{
public GameObject[ ] FilteredObjects;

// Start is called before the first frame update
void Start()
{
Metadata[ ] datas = FindObjectsOfType();
FilteredObjects = FilterByCatagory(datas, “Floors”);
}
// Filter Elements by Catagory
public static GameObject[ ] FilterByCatagory(Metadata[ ] datas, string category)
{
List FilteredList = new List();
foreach (var data in datas)
{
if (data.GetParameter(“Category”) == category)
{
FilteredList.Add(data.gameObject);
}

}
return FilteredList.ToArray();
}
}

Hey, depends on what you want to happen
use also “CODE” Tags so we can read your code easyier :slight_smile:

Thanks for your reply. The model in the scene has come from the Architectural software Revit.It was imported through the program Unity Reflect. Reflect brings in all the model data and metadata. Every element in Revit contains metadata. In this script I’m trying to select all the elements that has metadata pass it into an array. Search the array for all the elements that have a parameter called Category. Then filter out all the elements where the category parameter contains the string floors

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Reflect;
public class FilterData: MonoBehaviour
{
public GameObject[ ] FilteredObjects;

// Start is called before the first frame update
void Start()
{
// Every element in the scene has meta data attached as th model came from Revit through Unity Reflect
Metadata[ ] datas = FindObjectsOfType();
//I want to filter out all the floors by catagory
FilteredObjects = FilterByCatagory(datas, “Floors”);
}
// Filter Elements by Catagory. Put all the elements into the Array Datas
public static GameObject[ ] FilterByCatagory(Metadata[ ] datas, string category)
{
List FilteredList = new List();
//Go through every elemet and select all the elements that have a parameter category
foreach (var data in datas)
{
if (data.GetParameter(“Category”) == category)
{
FilteredList.Add(data.gameObject);
}

}
return FilteredList.ToArray();
}
}