I am loading obj model in real time. This is my code:
var houseObject = (GameObject)GameObject.Instantiate(Resources.Load("Models/" + houseNode["model"].GetAttribute("name")));
houseObject.name = "House";
Debug.Log(houseObject.renderer);
houseObject.transform.position = GetVector(houseNode["position"]);
houseObject.transform.localScale = GetVector(houseNode["scale"]);
The questions are the following:
-
Why my object is rendered in scene(in spite of houseObject.renderer is null)?
-
How can I hide this model if renderer is null (active = false is not a solution, I need get reference to it later using GameObject.Find(ObjectName) method)