How to make a 2d game dark

I am making a 2d game where I want it to be completely dark except for where the player is. I added a Halo effect to the player and then had no clue what to do for the darkness. I don’t want the sprites to be visible unitl the halo reaches them. How do I do this?

Hey, I’m not exactly sure what you want specifically, but couldn’t you just make an image in photoshop or gimp with a hole the size you want for your halo, and then just attach that to the player so it moves along with them? and if the image is large enough to cover the whole screen, then the sprites will only be visible when they are within the hole in black image. That may not be the best way to do it, but that’s the first idea i had.

If it’s not a pixel art game where you can have perfect circles, use a spot light. Since it’s 2D, just have it pointing down the Z axis. If you’d like, you can also add a Cookie texture to add noise or a special shape to the light.

In case it IS a pixel art game, you could still do the above, except you’d need an advanced shader of sorts to make the light create a pixelated area. I don’t go near shaders so I’m not even all that sure it’s possible.

Let me know if you need more help, or a more in-depth explanation.

ps. some quick tips about Unity Answers from a 2+ year user:

  1. If you want to make things more clear, edit your question, don’t add a comment to it.
  2. Don’t be desperate. If someone knows the answer, they would have posted it already. Saying “please help” won’t make people magically know the answer to your question.
  3. include as much info in your question. In this case, visual style of the game would be helpful to know what types of things work or don’t work.
    These tips will make it easier for you to get help in Unity Answers.