Hello!
I’m making a 3D game where a raincloud is dropping raindrops and the player is suppose to catch those raindrops with a basket. I’m having trouble with a code that I want to notify the player that a raindrop was dropped with this code
I get red line under the public void RaindropDestroyed and on the last } they only dissapear if I add [ ] above the code but then those get red lines. Anyone who knows how to fix it?
void Start () {
for (int i=0; i<numBaskets; i++) {
GameObject tBasketGO = Instantiate<GameObject>( basketPrefab );
Vector3 pos = Vector3.zero;
pos.y = basketBottomY + (basketSpacingY * i);
tBasketGO.transform.position = pos;
public void RaindropDestroyed() {
// Destroy all of the falling raindrops
GameObject[] tRaindropArray = GameObject.FindGameObjectsWithTag("Raindrop");
foreach ( GameObject tGO in tRaindropArray ) {
Destroy( tGO );
}
}
}
thank you in advance