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