- Home /
Question by
sona.viswam · Jun 13, 2013 at 07:07 AM ·
destroyarrayschildrenparenting
check a object is parent or not?
i have a object with childs.
During play, according to condition childs get destroy
if object dont have any child it should get destroy.
How can i destroy using
Destroy(objParent);
What condition should i write to check
Comment
Best Answer
Answer by BiG · Jun 13, 2013 at 07:13 AM
Just use:
if(transform.childCount == 0){
//...
}
Check also this good answer by skovacs1 for completeness.