Spotlight not visible

Hi,

There is probably an easy fix that I am missing, but I could use your help. I’m trying to add a light to my scene like so:
const spotlight = new SpotLight( 'spotlight_1', new Vector3(0, 0.5, 0), Vector3.Down(), Math.PI, 1, scene, ); spotlight.diffuse = Color3.Red(); const shadowGenerator = new ShadowGenerator(1024, spotlight); shadowGenerator.addShadowCaster( scene.getMeshByName('__root__'), true );
Afterwards, my spotlight shows up in the Inspector’s node list, but at no time does any part of my scene show up as lit with a red light. I have tried changing the position and direction Vector values, I have tried selecting difference sub-meshes of the ‘root’ mesh. I have also tried adjusting values using the Inspector, and I see no change whatsoever.

Is there some trick to working with spotlights?

The Playground example with the lamppost works fine within the PG, so I don’t see why it won’t work with my scene.

It should work, trying changing the intensity and height of the cone ?

A repro of your scene in the playground would definitely help.

Thanks @sebavan. This is a hard one to get in a playground. I’ll keep playing around with it. I must be doing something else wrong.

1 Like