StarToaster Posted July 8, 2017 Share Posted July 8, 2017 Hi, I'm getting some really odd issues when I am trying to extend Babylon JS objects. Example: class Scene extends BABYLON.Scene { } class Game { public engine: BABYLON.Engine; public currentScene: Scene = null; } Mesh = BABYLON.Mesh.CreateGround("newGround", 1000, 1000, 1, newGame.currentScene); Gives me the following errors: (9,69): error TS2345: Argument of type 'Scene' is not assignable to parameter of type 'BABYLON.Scene'. Property '_environmentTexture' is protected but type 'Scene' is not a class derived from 'Scene'. Is this something that is not supported? Weird thing is I had this working and then suddenly it stopped.. Thanks! -StarToaster Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 10, 2017 Share Posted July 10, 2017 This seems like a problem with versions of d.ts Can you try with the very latest version? Quote Link to comment Share on other sites More sharing options...
StarToaster Posted July 10, 2017 Author Share Posted July 10, 2017 23 minutes ago, Deltakosh said: This seems like a problem with versions of d.ts Can you try with the very latest version? I am running on 3.0.4-beta. I tried removing the node_modules folder and reinstalling everything, but I still get the same issue. The weird thing is if I create a new instance of BABYLON.Scene it works fine, but if I try to extend the Scene object it throws Argument of type 'Scene' is not assignable to parameter of type 'BABYLON.Scene'. Property '_environmentTexture' is protected but type 'Scene' is not a class derived from 'Scene'. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 11, 2017 Share Posted July 11, 2017 i have no idea Quote Link to comment Share on other sites More sharing options...
StarToaster Posted July 13, 2017 Author Share Posted July 13, 2017 Appears to have resolved itself when I installed babylonjs 3.0.7. Not sure what the issue was. 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.