Question by
alberto_ao · Oct 22, 2020 at 02:36 AM ·
gameobjecttransformattribute
What is the difference between accessing an attribute from GameObject.transform and accessing it directly from GameObject?
I have been watching an online course on Unity, and at several points the instructor stresses about accessing attributes through the transform
of a GameObject
. For instance, for the attribute name
of GameObject obj
, he would access it as obj.transform.name
. However, I see through the tooltip that I can access the attribute directly, as obj.name
. Is there any difference between both approaches?
Comment