Attach enemy-spawner beside camera

I make a 2D game where the player moves only upwards when you press a button, the goal is to get as high as possible without hitting any enemys in the sky (the enemys spawn outside the camera and move only horizontally through the screen).


My question is how i attach the enemy spawner to the camera, because if i just put the spawner static beside the camera, the enemys spawn in the view if the screen is wider and they spawn to far away if the screen is more narrow.

So what is the best way to make the game as responsive as possibel?

Make the Spawner GameObject a child of your Camera, and place it just out of visibility of the field of view. Then when you spawn your objects it will always be from same point related to the view. If you spawn enemies from above, and are only moving upwards, and the camera can only move up, then you could have a Random.Range(x1,x2) where x1 and x2 are the left and right side of your view, then your enemies are spawning randomly accross your screen.