when I run this function the function in the script I get an error which is "NullReferenceException: Object Reference not set to an instance of an object.But I can’t figure out where this error occurs.
I can see that the function works well to the GameObject.Find(“Room”) call but afterwards it stucks there. But I don’t understand why as “Room” is a valid object instantiated properly (I guess) and it corresponds a MeshFilter. Any idea if something else can generate that error.?
Actually I am investigating on it and Room is of type UnityEngine.GameObject. So, I guess it’s not null.
Room is a Prefab I load, and it has a sup component called “default” which contains the meshfilter… but for whatever reason I can’t get to access that field so If I call Room.GetComponent(“meshFilter”) I get the error.
so how can I access the “default” component as I tryed Room.GetComponent(“default”) but still having troubles.