access script of any gameobject in unity code example Example: unity get script from gameobject obj.GetComponent<Script>();