Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

Disposing of a light's parent leaves the light untouched

$
0
0

Hi

 

I tried turning a mesh into the parent of a SpotLight. It worked fine! But when i dispose the parent mesh, the spot light still remains in the scene.

 

Searching the forums i found this thread: http://www.html5gamedevs.com/topic/11230-how-do-i-attach-a-light-to-a-mesh/

That thread holds this example: http://babylonjs-playground.azurewebsites.net/#2AKHZK#2

 

Try to add the following lines of code to row 69...

lightSphere0.dispose();
lightSphere1.dispose();
lightSphere2.dispose();

...and you will find that the spheres are removed, but the lights remain.

 

Is this a bug or a feature? :) How do I dispose of the lights if I only know the parent mesh?


Viewing all articles
Browse latest Browse all 388


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>