void Start() { } // Update is called once per frame void Update() { If Input.GetKey (KeyCode.LeftArrow) { transform.Translate (-hiz,0f,0f); } If Input.GetKey (KeyCode.RightArrow) { transform.Translate (hiz,0f,0f); } } void OnCollisionEnter2D(Collision2D temas) { float random = Random.Range (-8f,8f); if (temas.gameObject.tag == "bottle") { sise.position = newVector3 (random,0f,0f) } }