Search the Community
Showing results for tags 'html file'.
-
Hey all! I’m a beginner at BabylonJS and ran into a problem. I spent a long time researching how to solve this on the internet, and couldn’t find a solution. I am running a HTML/JavaScript file locally with BabylonJS and my BabylonJS file is unable to see that I am (using a Cannon.js CDN)/(have Cannon.js saved locally) and prints the following error in the console window: BJS - CannonJS is not available. Please make sure you included the js file. BJS - [17:17:19]: Physics Engine CannonJSPlugin cannot be found. Please make sure it is included. This printout happens when I call “scene.enablePhysics();”. My project works just fine otherwise. (More errors appear when I try to use the physics engine that didn’t load, but that isn’t applicable here.) When I don’t enable physics, this error does not occur but of course, the physics engine doesn’t work then. I am using the following for CDN-calling: <script src="https://cdn.babylonjs.com/cannon.js"> When that didn’t work, I tried using the following below after having downloaded a copy of cannon.js (and putting it in the same folder as the .html file that is using BabylonJS). <script src="cannon.js"></script> I feel like I’m missing something very simple, but I’m not sure what it is. Something similar is happening when I try to use Oimo.js (though I would prefer cannon.js). I get the following error for Oimo.js ( “scene.enablePhysics(new BABYLON.Vector3(0,-9.81, 0), new BABYLON.OimoJSPlugin());”): babylon.js:44 Uncaught TypeError: Cannot read property 'World' of undefined at new i (babylon.js:44) at createScene (PlayingAround.html:193) at PlayingAround.html:330 Putting this code in a playground does not make sense because this line of code “scene.enablePhysics();” works just fine in the playground. I was wondering how I could fix this issue. Thanks in advance for the help!