unity get component iwht script code example
Example 1: unity gameobject.getcomponent
rb = GetComponent<Rigidbody>();
Example 2: unity get component
public GameObject Var; //only if the component you want is on a different gameObject
void Start(){
Var.GetComponent<Component>(); //just GetComponent<Component>(); if the component you want is on the same object as script
}