Files
beyond/Assets/ThirdParty/Invector-3rdPersonController/Basic Locomotion/Scripts/Generic/Utils/vRemoveParent.cs
2024-11-20 15:21:28 +01:00

26 lines
467 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class vRemoveParent : MonoBehaviour
{
public bool removeOnStart = true;
private void Start()
{
if (removeOnStart)
{
RemoveParent();
}
}
public void RemoveParentOfOtherTransform(Transform target)
{
target.SetParent(null);
}
public void RemoveParent()
{
transform.SetParent(null);
}
}