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