unity-game-enginemobileshadowtopdown

Unity2D Simulating height with Top Down Shadows


So the problem is the following: I have been trying to make this flying simulator little phone game, the problem is i cant make the shadow change with a smooth transition...

Image Before the cloud

Image in the cloud

That White squared is a cloud, and the objective is to have the shadow change size while in the cloud... I don´t really know were to start, i tried shaders, but i´m not that good with that... Thx :))


Solution

  • If you are not into shaders, I would look into Masks. Masks basically limit a sprite to only draw within it's boundaries.

    In this example, you could have a mask on the cloud. To make it work, have the "nearer" shadow be always drawn, but only in the mask's boundaries (In this case - the cloud) Relevant Youtube Tutorial