blondegeek Posted August 26, 2018 Share Posted August 26, 2018 In this playground example, I create and dispose a simple slider, without attaching the slider to a control panel. This produces an error because this._host (where the attached control panel is referenced) is not defined (see controls.ts line 1364). Should line 1364 first check if this._host is defined? For context, this error has come up for because I have sliders that are only visible and attached to a control panel when the relevant mesh that they control is selected but the mesh they control can be deleted even if not selected. I can provide more details if considered relevant. Thanks very much! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 26, 2018 Share Posted August 26, 2018 Hello, Your PG did not add AdvancedDynamicTexture. And your slider must also be added before using dispose (); You must also add a scene, camera and a light to the scene. You do not need to call the engine on the PG. It works here: https://www.babylonjs-playground.com/#PWHHMR#2 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted September 9, 2018 Share Posted September 9, 2018 I think you are correct, if you want to be able to dispose controls that have never been added to a texture and hence _link()... never called: if (this._host) { var index = this._host._linkedControls.indexOf(this); if (index > -1) { this.linkWithMesh(null); } } You could always do a Github pull request Quote Link to comment Share on other sites More sharing options...
Guest Posted September 10, 2018 Share Posted September 10, 2018 no worry I'll add the fix now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.