Clearing then reloading a new scene

Hi All,

I’m fairly new to Java3D.

I have a maze game which works well so far. I create a universe and add a BranchGroup to it and then fill in the obstacles by reading from a 2D array.

Now I’d like to be able to load a new level. How can I clear this scene and allow a new maze to be rendered?

So I create a SimpleUniverse, instantiate a new BranchGroup, and then add a textured floor, sky and then add the obstacles.

It doesn’t seem to work just re-instantiating a new BranchGroup again.

You must detach the BranchGroup for the previous level. Remember to set capability BranchGroup.ALLOW_DETACH.

Thank you! :smiley: