unity apply force to a rigidbody when it touches an object code example
Example 1: unity rigidbody addforce
rb = GetComponent<Rigidbody>();
rb.AddForce(new Vector3(1.5f,1.5f,1.5f));
Example 2: how to add reference to rigidbody 2d
public Rigidbody2D rb;