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