I have a Object called "Planet(clone)" (clone because its get instantiated) and it has a child called GravRad!
var lol;
function OnTriggerEnter(gr : Collider){
if(gr.transform.gameObject.name == "GravRad"){
gr.transform.parent.gameObject.name == lol;
Debug.Log(lol);
}
However in the console it says null but it has a parent in the hierarchy!
oh and i have set trigger enter on and i tested without a parent and it works (so the only thing that is not working is the gr.transform.parent.gameObject.name == lol;
↧