So I will start this off by describing what I am trying to do. That way when you read the problem, you might be able to tell me that I am going about it all wrong from the get-go.
I am trying to create a 2D tile map (done) that allows a player to move around(done) and casts shadows for the tiles outside what would be the line of sight(done). I also want to make sure that any npcs that are on these tiles, are also hidden(not done). The way I am currently hiding the tiles is by simply setting the alpha. This works well enough however the npcs would be a bit of a problem here. Sure I could just have the npc check the tile its on and mimic its alpha level however I would like to know if there is a more elegant solution.
I found projectors. This looked promising. I can in fact get this to work in a way however here is where I am running into the issues. It seems that all the standard shaders either have one(or both) of two flaws, 1) It does not respond to a projector. 2) It does not cooperate with materials that have a transparency. Below you will see an example of the problem(ugly tiles… I know… just place holders lol). The brown coloring around the human model should be transparent show an identical tile as soon on the left and right.
So… Can anyone point me into the right direction of either solving my problem or showing me where to look so I won’t have this problem?
The brown coloring is caused by a texture importer feature called “Alpha is Transparency”. However it also means that you’re using a material with incorrect blending modes setup. Sprite Default/Diffuse shaders should work fine in this case.
Please provide more details on the material you’re using and on what you want to use projectors for.
That would be an option. Thanks. Though it would force all objects below it to be shadowed by that amount. I would also like to preserve the ability to allow some objects to continue to be visible. Projectors have the ignore layer. Is there also an option for this apart from placing the objects I want above the shadow?
I actually went through and tried every single built in shader, the example image above is actually with Default/Diffuse. As to the material detail. What would be helpful?
What I want to use projectors for may not be the best question to answer. I am trying to create a Fog of War. Blackness in all areas unvisited, gray in all areas visited yet not in line of sight. I know of A way to do this, I am trying to figure out the right way to do it. Projectors are something I came across and thought might be a decent way to go about it.