Using OnparticleCollision noob problem

Hi everyone, I am new to learning C# and trying to wrap my head round this. Any help is most welcome! :slight_smile:

I am trying to use ‘OnParticleCollision’ to destroy an object and spawn two prefabs (explosionColliderPrefab and explosionPrefab) at the same time.
However. I have a parsing error at line 9 and I can’t see what it is and my two ‘public GameObject’ are not appearing inside of unity in the script Inspector window.
Could anyone please point me in the right direction? Thanks in advance!

	public class ParticleCollision : MonoBehaviour {
	// explosion prefab
	public GameObject[] explosionPrefab;
	// explosion collision prefab
	public GameObject[] explosionColliderPrefab;
}
	// explode if hit by a particle
	void OnParticleCollision(GameObject other)
		if (explosionPrefab) {
		// Instantiate an explosion effect at the gameObjects position and rotation
		Instantiate (explosionPrefab, transform.position, transform.rotation);
		}

		if (explosionColliderPrefab) {
			// Instantiate an explosion collider at the gameObjects position and rotation
			Instantiate (explosionColliderPrefab, transform.position, transform.rotation);
			}
				
			// if game manager exists, make adjustments based on target properties
			if (GameManager.gm) {
			GameManager.gm.targetHit (scoreAmount, timeAmount);
			}
				
			// destroy self
			Destroy (GameObject);

			}
}

just go into the particle’s properties, and apply a subemitter. You can set subemitters to instantiate prefabs at birth, death, and collision (and manual, but don’t ask me what that one means).
ParticleSystem > Subemitter > Add the prefab. Make sure the prefab is a child of the main particle instantiating the new stuff.