public void Throw() { Vector2 lookDir = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position; grabbing.GetComponent <Rigidbody2D>().velocity = lookDir.normalized * throwForce; grabbing = null; }
public void Drop() { grabbing = null; }
public void GrabBox(GrabbyBox toGrab) { toGrab.transform.parent = grabbedBoxPos; toGrab.transform.localPosition = Vector3.zero; grabbing = toGrab; }