Trouble with shadow caster

I’m having trouble getting a shadow to cast onto the ground from the car using a point light. The car mesh is imported and the shadowGenerator code is in. Any ideas where I’m going wrong?

https://www.babylonjs-playground.com/#YIU90M#30

I have this error but I can see the meshes imported:
BJS - [13:19:29]: Unable to import meshes from https://raw.githubusercontent.com/ryannewelluk/3dcar/master/basic-car.glb: Error in onSuccess callback: ReferenceError: includeDescendants is not defined

Thank you for any help

Holding the mouse over addShadowCaster reveals this:

image

So it expects one mesh, and a boolean of whether to include the descendants, but in the playground it’s given the meshes array and undefined variable includeDescendants

It does work when providing (car, true):

https://www.babylonjs-playground.com/#YIU90M#35

1 Like

Fantastic, great help again thanks. I didn’t realise you could mouse hover over the code for tips. Thanks for solving the problem.

1 Like