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 :
- I have an sunLightNode attached to rootNode.
- I have an planetNucleNode attached to sunLightNode.
- All objects in the app state are attached to planetNucleNode.
- After the gameover event, I remove all objects doing the planetNucleNode.removeFromParent();
- 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 ?