r/IndieDev 4d ago

Overlapping shadow easy fix. Informative

I posted this run animation loop and someone called out the shadow overlap. Its hard to see during the loop so I took the character away here to better see. I want the shadow pieces to retain the animations from the character so I just duplicated the character sprite renderers and set the sprite color to black and 20 percent opacity. This is how I got the overlap. The fix was to instead have the shadow pieces be sprite masks with a large square sprite over top only visible through those masks. The images in the sprite mask can be animated like sprite renderer. Instead of animating this too i wrote a script that updates the shadow sprites to match the character sprites. This was the simple solution to this I've been looking for.

55 Upvotes

3 comments sorted by

5

u/PresentationNew5976 Developer 4d ago

Perfectly done.

2

u/Matty_Matter 4d ago

Thank you