Projectile weaponry is not unheard of in the animal kingdom - cobra venom, venomous spider silk, velvet-worm slime, scalding water from bombardier beetles, archerfish spitting water, penguins expelling feces and petrel vomit are a few examples that I think of. However, these are all liquid projectiles, and I'm wondering about solid ones. Those are also seen in animals, but are usually limited to either fecal matter or objects from the environment.
Some cnidarians also have nematocysts/cnidocysts, which is probably the closest real-life thing to what I'm getting at.
My question is: could an animal, or animal-like alien, generate a solid projectile (Solely for the purpose of being fired) inside its body and then expel it with speed and force as a means of offense and defense?
If you have any queries, or wish to notify me of an error, please say so in the comments.