check if object has parent unity
Code Example - check if object has parent unity
if(transform.parent != null)
{
}
if(transform.parent != null)
{
}