dataarts/dat.gui

gui.removeFolder gives a Uncaught TypeError: folder.domElement is undefined error

rushcodes opened this issue · 0 comments

When I call:

gui.removeFolder(this.playerId);

or

folder.removeFolder('subfolder');

I get the error:

Uncaught TypeError: folder.domElement is undefined

I'm adding folders and subfolders like so:

this.playerFolder = this.scene.gui.addFolder(this.playerId);
this.targetPositionFolder = this.playerFolder.addFolder('TargetPosition');

this.scene is the scene object from the parent scene sent to a player object, playerId is a unique id per player. I'm calling it in the destroy() function above the super.destroy();

console.log'ing before calling either removeFolder() command shows the id exists. There is also a folder by that name.