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