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