unity c# check if parent has children code example Example: check if object has parent unity if(transform.parent != null) { }