To answer the first question, create a new tag called something like “EnemyTarget.” Assign this tag to all enemy targets that the turret should be targeting, add them to an array and loop through every object, checking which one is closest. I’m assuming that’s basically what you want to do, but if you just want to check if it’s a parent or not, you can just do
if (target.transform != transform.parent)
{
//FIRE FIRE FIRE!
}
This just checks if it’s targetting the parent. I can go into a little more detail in the first response if you need more help…if you’re fairly new to either scripting or Unity I can see how it might be a little confusing.
The second question is a bit vague, and my answer would depend mostly on exactly how you want the missile to move.