java.lang.IllegalStateException Error

1 reply [Last post]
Joined: 11/18/2012

java.lang.IllegalStateException: Scene graph is not properly updated for rendering.
State was changed after rootNode.updateGeometricState() call.
Make sure you do not modify the scene from another thread!
Problem spatial name: Root Node
    at com.jme3.scene.Spatial.checkCulling(
    at com.jme3.renderer.RenderManager.renderSubScene(
    at com.jme3.renderer.RenderManager.renderScene(
    at com.jme3.renderer.RenderManager.renderViewPort(
    at com.jme3.renderer.RenderManager.render(
    at env3d.EnvBasic.update(
    at env3d.advanced.EnvAdvanced.update(
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(
    at env3d.Env.advanceOneFrame(

i created a thread for the enemy AI and after i lower the Thread.sleep(100) to 50 this error would appear

and after re running my code again the window would only show black screen and would not show

the game world. I feared that ,maybe i can only use threads for updating the gameAI movements but not for changing graphic frames.

the game would only run if i set Thread.sleep to 100 but i want to reduce the value since the delay time would make the object move slower

including the movement animation.

Joined: 12/13/2010
You are correct in that you

You are correct in that you cannot use multiple threads to update the graphics.  This is a restriction in OpenGL.  Bascially, you can only have one thread updating the OpenGL context.  AI and other calculations can of course be done with other threads.