Mpman Posted February 11, 2017 Share Posted February 11, 2017 Hi all, I loaded 2 JS files into a web application (2 different zones and roles), both work great, the issue comes when i use the first JS file area, the camera is not dragging on screen once i call the second JS, almost as if the second JS killed the first JS camera functionality. Is there a way to Reload events in Babylon? so when i access the first JS a function can reload the camera? Both use the same camera but different camera name/vars. I do not wish to load multiple models, but multiple Babylon JS files. Thanks! Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted February 11, 2017 Share Posted February 11, 2017 Hi, @Mpman are you talking about two actual babylon.js files? Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 12, 2017 Share Posted February 12, 2017 Hi, We also need your loading method... If you use SceneLoader.Load twice, that may be your problem Quote Link to comment Share on other sites More sharing options...
Mpman Posted February 12, 2017 Author Share Posted February 12, 2017 Hi thanks for responding! I simply loaded 2 JS files into 2 separate divs in the same application. They see each other and there are no conflicts other than when i load the second JS, the first one's camera is not functioning (you drag the mouse and nothing happens). If i reload the first div it works but is slower than before. i suspect that there is a way to reload the camera part (which i tried), or use code that avoids the issue. I also removed the div that holds the second JS and went back to the first div and the issue remained almost as if the initiation of the second JS changed the first one forever (upon initiation). Each JS does use "BABYLON.SceneLoader.ImportMesh" and by renaming similar vars i.e. camera --> camera2 i managed to avoid any other conflicts. Quote Link to comment Share on other sites More sharing options...
Mpman Posted February 12, 2017 Author Share Posted February 12, 2017 ISSUE RESOLVED :)) On the second JS i used scene in the main code and a new var for the createScene part (scene2)... I also removed the babylon.js lib call from the second JS. FIRST JS var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); SECOND JS var scene2 = createScene(); engine.runRenderLoop(function () { scene2.render(); }); 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.