Using shadowcaster2d in URP: (2022.2.4f1)
I build 2d walls at runtime of various dimensions, so they are basically textured quads. I add a light2d to the scene and shadowcaster2d to the walls, but the shadows created arent the same shape as the walls; they are slightly fatter, meaning the shadows leave gaps. Some shadowcasters are randomly at 90 degrees to the wall (looking at the shadowcaster points in the inspector, they look like the wall, turned 90 degrees). I can manually adjust the shadows at runtime using the shape button, and that fixes the error, so for some reason the shadowcaster is not finding the correct object shape. (my colliders and other attached features on the wall are in the correct position). I see some threads from a decade ago about workarounds to set the shadpcaster2d shapepath from the collider path. I’ve tried having shadowcast added to the prefab as a component, and Ive tried adding at runtime…same result. Is there yet any better way to do this? I see the shapePath property is still read only. (Or am I just making a rookie mistake somewhere?) Many thanks, once again.