GameState render issue

Hello everyone,

I'm having some trouble implementing GameStates into my game so I was hoping to get some advice on what might be wrong.

I have implemented things based around the TestGameStateSystem, with my main game in a BasicGameState. Everything works fine in the beginning, the "menu" state loads correctly and when I enter my game it runs everything it should, attaching children to their nodes etc. But, when everything is done loading, im faced with a black screen. I can see from my logging that I get response from the game and the input, and the strangest thing is that if I flick around the camera in frustration (as in really fast in all directions) I can sometimes see graphical elements, or part of them, pop into view for a split-second. I'll paste some code if you want but since I'm not really sure where the problem originates from I'll wait for some response before I do that.


So I've been working some more and now the scene renders for a very short time (1 frame?) when I go into the BasicGameState before everything goes black as before.

Here is the render and update in my GameStateManager:

   protected final void update(float interpolation) {
      // Recalculate the framerate.
      tpf = timer.getTimePerFrame();
      // Update the current game state.

   protected final void render(float interpolation) {   
      // Clears the previously rendered information.
      // Render the current game state.

And this is how it looks in my BasicGameState:

    public GameplayState(String name) {
      width = DisplaySystem.getDisplaySystem().getWidth();
      height = DisplaySystem.getDisplaySystem().getHeight();

      cam = DisplaySystem.getDisplaySystem().getRenderer().createCamera(width, height);
        fpscam =
      cam.setFrustumPerspective(45.0f, (float) width / (float) height, 1,
      /** Signal that we've changed our camera's location/frustum. */
                  (float) width /
                  (float) height, 1, 5000);
         Vector3f loc = new Vector3f(30.0f, 30.0f, 30.0f);
         Vector3f left = new Vector3f( -1.0f, 0.0f, 0.0f);
         Vector3f up = new Vector3f(0.0f, 1.0f, 0.0f);
         Vector3f dir = new Vector3f(0.0f, 0f, -1.0f);
           /** Move our camera to a correct place and orientation. */
         fpscam.setFrame(loc, left, up, dir);
           /** Signal that we've changed our camera's location/frustum. */


    * During an update we only look for the escape button and update the timer
    * to get the framerate.
    * @see
   public void update(float tpf) {
      if (KeyBindingManager.getKeyBindingManager().
            isValidCommand("exit", false)) {
         // Here we switch to the menu state which is already loaded
         // And remove this state, because we don't want to keep it in memory.
      // third-person stuff
      float time = Timer.getTimer().getTimeInSeconds();
      //Om tryck, aktivera beam
         if(player.isBeaming()) {
            //Minska energi
          if(charge + lastUpdate <= time)           
            lastUpdate = time;
          //Om slut p


Could you please check for

if (Float.isNaN(cam.getLocation().y )


  System.out.println("NAN detected");


I have a similar problem my Camera gets changed during the update most of the time successfully but under rare circumstances it get out of the sudden a NaN value in its coords. Screen is black than obviously.