I’m trying to apply force to an object in the opposite direction of a public Vector2, although I don’t know what to put after the AddForce. I tried (-velo) but it didn’t do anything. Thanks for any help!
public Vector2 velo;
void OnCollissionEnter2D (Collider2D col) {
if (col.gameObject.tag == "ground") {
GetComponent<Rigidbody2D> ().AddForce ();
}
}
void Update () {
velo = GetComponent<Rigidbody2D> ().velocity;
}