Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created November 24, 2022 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/3a18256057e56d701a40da6dd832242f to your computer and use it in GitHub Desktop.
Save flushpot1125/3a18256057e56d701a40da6dd832242f to your computer and use it in GitHub Desktop.
scene.registerBeforeRender(function () {
scene.meshes.forEach(function (m) {
if (m.name=="ballInstance" && (m.position.z <-100)||(m.position.z > 100)) {
m.dispose();
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment