Hi Guys…
My game is occasionally crashing with the exception
java.lang.ArrayIndexOutOfBoundsException: 2
at com.jme3.util.SafeArrayList.get(SafeArrayList.java:258)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:683)
which i understand is because i have been changing the scene graph out-side the main update loop… (im in process of fixing these)
But according to to the wiki i can only make changes in
“only in Control.update(), AppState.update(), or SimpleApplication.simpleUpdate()”
So what about onAnalog and onAction?
public class RealTimeStrategyAppState extends AbstractAppState implements ActionListener, AnalogListener{
public void onAnalog(String name, float value, float tpf) {
app.getRootNode().detachChild(line1);
}
public void onAction(String name, boolean isPressed, float tpf) {
app.getRootNode().detachChild(line1);
}
}
Is it ok for me to change the scene graph here?
Or is this bad as well?