[SOLVED] Light Question on restarting Level

I have a question when it comes to restarting a level, after a player dies.

I’m not sure if I’m doing this correctly or not.

I remove the map level from rootNode and remove all physics and spatials (which gets the controls). Then I go through the viewport and delete the lights that the map added.

My issue is when it start everything is okay except the Lights. It really hasn’t removed them. The frame buffers increase and the lights projections are added to the game. So second time through there is double, 3rd time is 3 lights for each one light.

What is the proper way to remove lights to restart the level. Since frame buffers are not being deleted I can tell I’m not really getting rid of them.


I figured it out, I was removing the lights but never removed the FilterProcessor from the viewport.