unity 2d apply force code example
Example 1: how to make rb.addforce 2d
public Rigidbody rb; //make reference in Unity Inspector
public float SpeedX = 0.1f;
public float SpeedY = 0.5f;
rb.AddForce(new Vector2(SpeedX, SpeedY));
Example 2: unity rigidbody addforce
rb = GetComponent<Rigidbody>();
rb.AddForce(new Vector3(1.5f,1.5f,1.5f));