Files
HauntedBloodlines/Assets/Scripts/ParentObject.cs
2025-05-29 22:31:40 +03:00

22 lines
495 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParentObject : MonoBehaviour
{
public Transform parent;
public Transform targetChild;
public bool makeChildPosZeroToParent;
public void MakeParent()
{
targetChild.SetParent(parent);
if (makeChildPosZeroToParent)
{
targetChild.localPosition = Vector3.zero;
targetChild.localRotation = new Quaternion(0, 0, 0, 0);
}
}
}