2D Shadows

Guys,

I’ve never worked with shadows in a 2D Game, how hard is to implement shadows in Unity Pro for a 2D Game? I can’t figure it out for some reason.

Sadly the only way to do it is by baking them into your sprites. If you want to use unity shadows then you have to use 3d meshes and lighting which defeats the whole pure 2d workflow.

See this thread:

http://forum.unity3d.com/threads/215461-Why-can-t-Sprites-gameobjects-cast-shadows

I had thought sprites could not easily have shadows, but a few guys talk about how to do it in this thread.

Oh and also, you’s two guy’s avatar images are like strangely similar hahaha

Mmm yes I don’t want to use any 3D in my game, that would mean I had to change all my models to planes instead of sprites. What do you think about this script?

well its not exactly ruining the whole 2d parts of things… like you can keep everything orthographic and stuff, with your parallax scrolling and such, and the user wouldnt notice any lack of “2D-ness” if you used a shadow setup like in that thread I posted… truly even the most “2D” of games in unity, is still really 3D lol…

so yeah you can still use sprites, with a few settings changed up, to allow them to cast a shadow onto other sprites… good luck!

To quote myself from the thread MD_Reptile mentioned…

As option 1 indicates you can use sprites you just have to change the shader yourself. If you want “shadow shafts” similar to the unitycoder blog you can use option 3.

There is also an asset dealing with this sort of shadows (although I am unsure if it supports unity sprites):
http://forum.unity3d.com/threads/142532-2D-Mesh-Based-Volumetric-Lights

I will give it a shot this is what I have so far for my game but it seems like shadows will improve the overall scene:

looking good, some shaft effect style lighting would be cool there maybe!

Yes that’s what I need to figure out how to add. Working on it :slight_smile: