GetComponent script on own gameobject unity code example Example: unity gameobject.getcomponent rb = GetComponent<Rigidbody>();