position of enemy is out of range of camera which is gernated by random no

I am gernating random no for my enemy’s position. but after few enemys next enemy appears out of camera’s range. what should i do to avoid that.

If you are using Random.Range, first find your camera view limits and use them as limits when you generate your randoms.