There's been an error

严重: Uncaught exception thrown in Thread[jME3 Main,5,main]
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(Spatial.java:367)
	at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:792)
	at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:780)
	at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1205)
	at com.jme3.renderer.RenderManager.render(RenderManager.java:1287)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:278)
	at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:628)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:717)
	at java.base/java.lang.Thread.run(Thread.java:833)

I don’t know why this error occurs, but I’d like to know what I can do to prevent it from happening :thinking: :thinking: :thinking: :thinking:

The most likely reason is, you attached or detached a spatial in another than the JME3 Main Thread. For this, you can enqueue Runnables or Callables by SimpleApplication#enqueue(). They get executed at the begin of the main loop.

1 Like

^ don’t do it. With multithreading you need to use Application.enqueue() to apply your changes to the scene graph.

1 Like

Thank you for your reply.

Thank you for your reply. :grey_exclamation: