[SOLVED] Issue with lights and nodes

I am facing an issue with lights and nodes where the lights gets off after I detach and re-attach the run appstate as follow :

  1. I have an sunLightNode attached to rootNode.
  2. I have an planetNucleNode attached to sunLightNode.
  3. All objects in the app state are attached to planetNucleNode.
  4. After the gameover event, I remove all objects doing the planetNucleNode.removeFromParent();
  5. In an new game event I just recreate the planetNucleNode and attached it to the sunLightNode.

Everithing looks ok, and works the first time the game state runs , but after I do the planetNucleNode.removeFromParent() in the appstate cleanup, and start an new game (new appstate), the lights gets off.
I just debuged and saw that sunLightNode is not null and have the ligths when I attach the planetNucleNode.
Its seens the light dosent know there is new childrens to iluminate at the second time the app state runs…
There is anything I am doing wrong ? Maybe there is some sun.refreshLigthsOnChildrens or appstate.refreshlights I should be using and I didnt notice ?

It seens I have fixed it.
I was creating an new appstate every-time an new game starts, it seems to be an incorrect approach, so I started to keep an generic gameplay appstate where I can change dynamically the levels and difficult, it fixed the problem with the lights.