The spotlight here doesn’t make any of the objects on the table cast any shadows.
However, the table itself does cast a shadow on the floor.
Weirdly, about half of the air hose from the spray gun casts a shadow… the half that’s closest to the floor.
Scale is 1:1 life size, since this is for VR use.
EDIT: I wonder if it has to do with this… Still in UNITY 5 - Unbelievable: Spotlight Shadow cut off at "close" distance. - Questions & Answers - Unity Discussions
It should be casting shadows. Here are some things to check.
- On the inspector for the light, make sure cast shadows are on. Without it the light won’t cast shadows.
- On the mesh renderer for all objects you want to cast shadows, make sure they’re configured to cast shadows.
- In your quality settings, make sure the shadow distance is large enough to encompass the area you want shadows cast.
- Make sure (don’t laugh, I’ve done this) the camera is just not at an angle where you can’t see the shadows.
- If you’re using baked lighting, make sure you’ve baked light maps. In the lighting panel press Bake or make sure Auto is checked.
Shadows are on everywhere, and it does cast a shadow, but only at very specific distances between the floor and the spotlight origin.
I do not use any baking at all, since the entire scene must potentially move.
bgolus
4
Try reducing your spot light’s near plane.
That did not work, but increasing it did have a result. Very weird!
Is there a better way to get directional light type of shadows on other lights than directional? This is a realtime lit indoors scene.
TomBath
6
This worked for me in 2023 - thanks for the comment!