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