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