getcomponent

Code Example - getcomponent

                
                        public Gameobject a; //this allows you to drag an object into a slot in the unity software
private transform b; //this is a variable that can only be assigned and altered in script

b = a.GetComponent<Transform>(); //this finds the transform component of 'a' and assigns that to 'b'