How to randomly generate stars in Unity2D?

I’m making a game in unity about space exploration and I don’t want to manually create the map because then there becomes a limit to how far you can explore. But don’t quite know how to procedurally generate stars so that the player can see the spaceship most of the time. But I just don’t know where to start, any thoughts?

Here is how I did it, the stars are two tillable textures that I scroll along the x axis and y axis, I used one free space texture and then rotated 90 degrees to make the second, but nowadays you can generate textures online. For the asteroids use a pooling system and I have them spawn in randomly in a donut shape around my character, so they spawn not to far but out of camera range and the velocity is randomized. If the asteroid gets too far away it respawns.

There are a lot of other ways to do it too, you could probably use particles or shaders, but this is how I did it.

I wanted to add in a layer of space mist over top too which would help for the effect, but never got to it. Good luck.

Space Survival: Generating Infinity - YouTube feel free to like the video!