Content-Length: 18002 | pFad | https://docs.unity3d.com/ScriptReference/Transform-root.html
Returns the topmost transform in the hierarchy.
(This never returns null, if this Transform doesn't have a parent it returns itself.)
using UnityEngine;
public class Example : MonoBehaviour { // Is a collision between two objects with different roots? void OnCollisionEnter(Collision collision) { if (collision.transform.root != transform.root) { print("The colliding objects are not in the same hierarchy"); } } }
Fetched URL: https://docs.unity3d.com/ScriptReference/Transform-root.html
Alternative Proxies: