Another way to do that is going directly to the root, because parent it’s relative to a child and… what happens if you someday change the order of your nested prefab inside of the hierachy?.. maybe the gameObject father turn into gameObject grandfather!
i created prefab with one parent object and 7 child objects…My requirement is i have to remove whole particular object when user touched any child object and i have to replace one object to that hit point…
am using Destroy(hit.transform.parent.gameObject) code…it removes object
when object is touched…
my pbm is mouse drag or multiple time touched same object in different child, that function is calling that many times…
i donk know what was the pbm…Fist touch itself am removing object…but how it takes 2 touch to the same object???..