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