My English is not good. I hope you can understand what I said
Put missile and cannon/bomb together and let them have the same name. Input -1 into the Armed Group of cannon/bomb. Input -FireWeapons into the Armed Group of missile.Set the missile's lockTime to 0. Set the missile's max TargetingAngle to 360.And you'll also have to test it yourself a few times based on your weapon, and adjust it based on the results. For example, increase or decrease the weight of the weapon.
https://www.simpleplanes.com/a/Oat21X/GP-500C
The link to the bomb is here. You can study this method based on it
https://www.simpleplanes.com/a/uTW39A/Lockheed-Martin-AGM-158-JASSM-cruise-missile
I learned from it