Problem in AppState attach and detach (runs slowly) [solved]

i have 3 App States :
1- start menu (main menu)
2- video player state (shows a video clip)
3- and running game state (where the gamer experiments the game)

in third app state there is a first person camera.
in running game app state when I attached start menu and detached its self it work fast and correctly , but when i come back to running game app state from start menu again and when I move the flying camera in that environment it will render models broken (fps is 60 but cam movement seems slow very slow ).
every time slower than before! but memory and cash is Normal.
can you help me?

There is no magic in attach/detach… so it must be a problem with your app state not cleaning things up properly.

1 Like

i add every thing to localRootNode and attach /detach it to/from root node.
so where is the problem?

but when I came back to runningGameState the camera position not (0,0,0) .
Idont know why!

I’m holding a piece of string. Can you tell me how long it is?


that is right.
the problem was in adding lights to root node . so every time i attach an app state a new sun light was added to root node and it will slow the game…
thank you so much for the time that you have spent for me.

42! But I don’t know which unit…