(スクリプト)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Name : MonoBehaviour { void Start() { print("自分の名前は、" + this.gameObject.name); print("1つ上の親の名前は、" + transform.parent.name); print("最上位の親の名前は、" + transform.root.name); } }