- Home /
Making a sprite totally dark without lighting
I'm practicing my understand of the new 2D features in Unity 4.3.
As part of that, i'd like to create a simple Pong game with a small twist - the ball will have a light source (point light) attached to it, and so each player's paddle will only be visible once the ball gets close to it, adding a bit of a challenge to the game.
For this to work, I need both player's paddles (sprites) to be completely dark in the scene, and only made visible once the point light gets near enough.
I've already seen this link: Way to have 2D Sprites lit by Lights that partly works (sprite is affected by lighting).
However, even with this technique, the sprite is still visible on the screen without any lighting.
How can I set up the sprite to be totally dark when no lighting is applied?
Answer by OtsegoDoom · Apr 25, 2014 at 12:22 PM
Although tis doesn't involve lighting, you could have the sprites fade out the further they are from the ball. When the ball is within a certain range of the paddle, the paddle becomes totally opaque (Alpha 1.0) when the ball is a certain distance away the Alpha would be 0.0. Anything in between those two distances would be a number between 0.0 and 1.0.
Your answer
Follow this Question
Related Questions
Default Tilemap Material not affected by light 1 Answer
Sprite and Material 0 Answers
Pixels from a sprite aren't the same size 0 Answers