Polyps can detect certain substances such as sugars and amino acids. This sense, similar to our senses of smell and taste, enables corals to detect prey.
Tiny sensors in the ends of nematocysts in polyp's tentacles trigger the nematocyst to eject. These sensors are stimulated either chemically or physically.