Hi, i have two camera. A camera is the main, the second camera is displayed when the mouse is on the button. there is the render of the object but my object isn't visible. i don't understand. function Entrata(){ //Quando entro devo ottenere dei dati dal bottone in esame // se l'id derivante dal bottone è uguale a uno di quelli presenti in conta // allora renderizza l'oggetto var i=0; allChildren = GameObject.Find("Inventario/showInventory").GetComponentsInChildren.<drag>(); for (var child : drag in allChildren){ if(child.GetComponent.<drag>().allInfoObject.id == CloneObject.id && i<=conta){ [*] prefab = Instantiate(CloneObject.oggetto); [*] prefab.transform.position = position2Camera; [*] prefab.GetComponent.<MeshRenderer>().enabled = true; [*] prefab.GetComponent.<BoxCollider>().enabled = true; [*] prefab.GetComponent.<drag>().enabled = false; [*] } [*] i++; [*]} [*]GetComponent.<Camera>().enabled=true; [*]} The transform.position's coordinate is correct. i tried with a object and it is visible. but with my code isn't visible. why?
awesome when you paste code into the forums use the [ code] [ /code] tags to format it nicely, there is a sticky in the scripting subforum as to how to use them