void OnCollisionEnter2D(Collision2D _object) { if (_object.collider.CompareTag("Ground")) { isGrounded = true; jumped = false; Gravity = 0f; if (!TakenFruit) { Boost(false, new Vector2(0.1f, 0.1f)); } else { TakenFruit = false; } } if (_object.collider.CompareTag("Fruit")) { //Debug.Log ("Hit Fruit"); Fruits _fruits = _object.collider.GetComponent <Fruits> (); _fruits.PickFruit(); Boost(true, _fruits._EffectValue); TakenFruit = true; effects.Play(); } }