I am making a demo of a sci-fi game in space.
I have a missile, that flies to certain target. I also have a spaceship GameObject. Inside this spaceship GameObject there is a ShipBody with Box Collider, and this Collider is the target for the missile. When I fire the missile it aligns to the target and moves slowly to it - this works fine for me. But after launching multiple missiles at once I saw, that they all fly straight to the center of the ShipBody, and it looks unrealistic. So I made a function that when a missile is acquiring target it also generates random offset inside the mesh of the Collider, so missiles seem to hit different spots of the ShipBody - and it works fine.
The problem is when I rotate the ship. It still flies to the position+offset, but it do not recognize the rotation of the main object. I hope image will clarify this.
I dont want to do this by just creating empty GameObject inside SpaceShip - what if there will be hundred missiles and dozens of ships. I dont want to litter the scene with useless GameObjects. I will do this, if this is the only way, but If there is more elegant one, I will try to implement it.