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

22 lines
516 B
C#

using Invector.vCharacterController;
using UnityEngine;
namespace Invector.Utils
{
public class vSetParentOfController : MonoBehaviour
{
[vHelpBox("Set this GameObject as parent of the Controller")]
private vThirdPersonController cc;
public UnityEngine.Events.UnityEvent onStart;
private void Start()
{
cc = GetComponentInParent<vThirdPersonController>();
transform.parent = cc.transform;
onStart.Invoke();
}
}
}