Jump to content

Using game map made in Blender this._worl undefined ERROR


Recommended Posts

Hello! I have a problem with using map made in Blender. Everything is working when I am using a map made out of just one plane with textures. But when I use this one, which consists of different objects and multiple textures, it shows a this._world is undefined error. Everything works just fine when using Sandbox. I really don`t understand what is the problem.


 You can access the file here: https://www.dropbox.com/s/6od5tp9ppg06o42/Blender.zip?dl=0




Link to comment
Share on other sites

Welcome to the BJS forum Andre :)


I downloaded your file and it does work in the sandbox.


So I tested it on my local server using the very simplest of code in the body of my HTML file:

<script>    if (BABYLON.Engine.isSupported()) {        var canvas = document.getElementById("renderCanvas");        var engine = new BABYLON.Engine(canvas, true);        BABYLON.SceneLoader.Load("", "RealMap11.babylon", engine, function (newScene) {            // Wait for textures and shaders to be ready            newScene.executeWhenReady(function () {                            var myCamera2 = newScene.getCameraByName("Camera");                myCamera2.speed = .2;                myCamera2.checkCollisions = true;                newScene.activeCamera = myCamera2;                                                // Attach camera to canvas inputs                newScene.activeCamera.attachControl(canvas);                                                // Once the scene is loaded, just register a render loop to render it                engine.runRenderLoop(function() {                    newScene.render();                });            });        }, function (progress) {            // To do: give progress feedback to user        });                            }        // Resize        window.addEventListener("resize", function () {            engine.resize();        });    </script>   

When I try to run it I get this error:


ReferenceError: OIMO is not defined



This suggests to me that BJS is looking for oimo.js to handle physics operations. Is it included along with babylon.js in your HTML page header ? Looking at your .babylon file it does contain code like this:

{"name":"Plane","id":"Plane","materialId":"RealMap11.Multimaterial#1","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[1,1,1],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"useFlatShading":false,"checkCollisions":true,"receiveShadows":false,"physicsImpostor":8,"physicsMass":0,"physicsFriction":0.5,"physicsRestitution":0 .....

I'm not sure of the current level of supoort for physics functionality that gets exported from Blender. Maybe JCPalmer and others can provide more info.


cheers, gryff :)


Link to comment
Share on other sites

Woow so simple...its working! Thank you all for your help! :) Thanks iiceman, I appreciate it! I have imported physics as a mesh, and now mesh to mesh collision is not working as my character can walk through objects. Could anyone give me some further advice on what could be the problem?

Link to comment
Share on other sites

Since collisions with the camera worked just fine in gryffs link the only thing I could think of would be that you didn't set "checkCollisions = true" on your character.. But that's just a wild guess. Maybe try your setup first in the playground without any imported meshes, just the plain old primitive shapes like spheres and boxes. If you can show a problem in the playground it's much easier to find a solution.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...