Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't destroy the scene in order to create it again. "scene is not defined". #335

Open
SoulDesignerTom opened this issue May 1, 2023 · 0 comments

Comments

@SoulDesignerTom
Copy link

SoulDesignerTom commented May 1, 2023

Describe the bug
I'm trying to use xeogl for a website. The problem is that i have multiple scenes defined like:

var scene = new xeogl.Scene({ id: 'lcb', canvas: "lcbCanvas" });

Everything works very well - except i would like to make performance better and destroy scene every time it closes on click function.
I'm trying to use something like:

scene.destroy() each time i'm closing view of the scene. But i've got an error: Uncaught ReferenceError: scene is not defined.

I was also trying to manually remove <canvas> from HTML DOM - but then when i wanna create scene again it sais that scene already exists: xeogl.js:27978 [ERROR] Scene 'lcb' already exists.

I was even trying to make variable var scene = global like scene = but it still doesn't work.
It doesn't give an error again about scene is not defined but - i still cannot recreate it.

Expected behavior
It should work: scene.destroy(); to eliminate scene.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant