void OnTriggerEnter2D(Collider2D ingredient) { if (ingredient.gameObject.tag == "Bouncer") { //Absorbs Ingredient and Checks if Ingredient is Relevent. //Debug.Log(ingredient.gameObject.name + " entered the thing"); Splash(ingredient.transform.position.x, 1.5f); AbsorbSheep(ingredient.gameObject); spawner.DropBall(); //References the Child Objects of the RecipeUI Parent Transform[] t = ingredient.gameObject.GetComponentsInChildren <Transform>(); Transform theParent = t[0]; Transform firstChild = t[1]; recipeManager.currentFallenIngredient = t[1].tag; Debug.Log(recipeManager.currentFallenIngredient); recipeManager.RecipeManager(); Instantiate(particle, ingredient.transform.position - new Vector3(0, 0.5f, 0), transform.rotation); /* Old Code, Used specifically towards the old version of the game */ // //if a sheep // Debug.Log(other.gameObject.name + " entered the thing"); // Splash(other.transform.position.x, 1.5f); // AbsorbSheep(other.gameObject); // spawner.DropBall(); // spawner.lives--; // // FindObjectOfType<ScoreUIScript>().SetScoreDisplay(); // // Instantiate(particle, other.transform.position - new Vector3(0, 0.5f, 0), transform.rotation); } }