how to apply force to object in unity code example
Example: how to add a force to an object unity
private Rigidbody2D rb;
public Vector2 direction;
public float force;
void Start()
{
rb = GetComponent<Rigidbody2D>();
rb.AddForce(direction * force, ForceMode2D.Impulse);
//rb.AddForce(--pass in Vector--, --can pass in ForceMode--);
}