unitytips: ShadowCaster2DFromCollider Component
This happens because
ShadowCaster2D does not update its internal shape according to the
I created this script to help to have SpriteShape with ShadowCaster2D casting right shadows.
To use it you need to add a PolygonCollider2D or an EdgeCollider2D to your
SpriteShape's gameobject and then add the
ShadowCaster2DFromCollider component to the same gameobject.
Below you can see a video showing a scene with some SpriteShapes before and after applying the ShadowCaster2DFromCollider component.
This solution was based on this Unity Forum post: https://forum.unity.com/threads/can-2d-shadow-caster-use-current-sprite-silhouette.861256