Borislav Posted April 5, 2017 Share Posted April 5, 2017 Compiltation error Line 9:1275 - Cannot read property 'dispose' of undefined I get this when I attempt to add this to my game: var shadowGenerator = new BABYLON.ShadowGenerator(1024, light); shadowGenerator.getShadowMap().renderList.push(sphere); ground.receiveShadows = true; But, when I delete this I still continue to get it for no reason. To return back I need to refresh the page. Quote Link to comment Share on other sites More sharing options...
spinnerbox Posted April 5, 2017 Share Posted April 5, 2017 run console.log(); with each property in the code above and check where it will print "undefined". You are accessing dispose field of something which doesn't exist in memory or it is other place. Or you forgot to intialize something before the code above. Quote Link to comment Share on other sites More sharing options...
Borislav Posted April 5, 2017 Author Share Posted April 5, 2017 6 minutes ago, spinnerbox said: run console.log(); with each property in the code above and check where it will print "undefined". You are accessing dispose field of something which doesn't exist in memory or it is other place. Or you forgot to intialize something before the code above. Compiltation error Line 8:23846 - r.needCube is not a function Quote Link to comment Share on other sites More sharing options...
spinnerbox Posted April 5, 2017 Share Posted April 5, 2017 I cannot read your code telepathically, you must debug it yourself. Quote Link to comment Share on other sites More sharing options...
c75 Posted April 5, 2017 Share Posted April 5, 2017 1 hour ago, Borislav said: Compiltation error Line 8:23846 - r.needCube is not a function seems you tring to use shadows with HemisphericLight. It does not work with this type of light Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 5, 2017 Share Posted April 5, 2017 This seems to be the good reason Quote Link to comment Share on other sites More sharing options...
Borislav Posted April 6, 2017 Author Share Posted April 6, 2017 On 05.04.2017 at 4:41 PM, c75 said: seems you tring to use shadows with HemisphericLight. It does not work with this type of light Hm... I am somewhat newbie so I don't understand lots of things. I read the tutorial and I copied the script and customised it for my game(changed torus to sphere). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 6, 2017 Share Posted April 6, 2017 Can you share you problem using the playground? Quote Link to comment Share on other sites More sharing options...
WhoAteDaCake Posted May 2, 2018 Share Posted May 2, 2018 If someone also gets > this._light.needCube is not a function It's because you are using a HemisphericLight, would probably be good to add this information in docs GameMonetize 1 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.