private void OnCollisionStay(Collision other) { Gumball ball = other.gameObject.GetComponent <Gumball>(); if (ball != null) { Rigidbody rb = other.gameObject.GetComponent <Rigidbody>(); rb.AddForce(transform.up * force, ForceMode.Impulse); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player") && top == 0) { Gumball gumBall = collision.gameObject.GetComponent <Gumball>(); gumBall.score++; top++; print("wearedoingitman"); } }