diff --git a/Assets/Scripts/Behaviours/YeetController.cs b/Assets/Scripts/Behaviours/YeetController.cs index 563c6eb..9cc92b4 100644 --- a/Assets/Scripts/Behaviours/YeetController.cs +++ b/Assets/Scripts/Behaviours/YeetController.cs @@ -34,6 +34,7 @@ public class YeetController : InputBehaviour private LineRenderer m_lineRenderer; private AudioSource m_audioSource; + private Transform m_OldChildParent; private Vector3 preyeetPosition; @@ -49,6 +50,7 @@ public class YeetController : InputBehaviour m_audioSource.clip = childClips[Random.Range(0, childClips.Length)]; _child = child; + m_OldChildParent = _child.transform.parent; _child.transform.parent = parent.transform; _child.GetComponent().held = true; _child.GetComponent().lastHeld = parent; @@ -78,7 +80,7 @@ public class YeetController : InputBehaviour m_YeetAnimator.SetBool("Yeet", false); m_YeetAnimator.SetBool("Carry", false); - _child.transform.parent = null; + _child.transform.parent = m_OldChildParent; _child.transform.rotation = parent.transform.rotation; _child.GetComponent().held = false;