unity get component of gameobject code example Example: unity gameobject.getcomponent rb = GetComponent<Rigidbody>();