Jump to content

BABYLON.MeshBuilder.CreateLines throws Uncaught TypeError


lesterhaus
 Share

Recommended Posts

Hi guys,

I'm having troubles drawing some lines out of a Vector3 array with MeshBuilder.CreateLines / Mesh.CreateLines..

I've seen many examples of drawing lines in various playgrounds

e.g. http://www.babylonjs-playground.com/#1DKDYG#0 - http://www.babylonjs-playground.com/#RF9W9

However, when I try to use these examples in my environment I get the following error:

Uncaught TypeError: Cannot set property isPickable of #<i> which has only a getter
i @ babylon.2.3.js:5
r @ babylon.2.3.js:10
i @ babylon.2.3.js:18
createScene @ LineScene.js:93 <- my awesome babylon scene :P

 

I was not able to reproduce this error in the playground, the part of my code which causes the error:

..
           
// shape
var shape = [
    new BABYLON.Vector3(1, 0, 0),
    new BABYLON.Vector3(0.2, 0.3, 0),
    new BABYLON.Vector3(0, 1, 0),
    new BABYLON.Vector3(-0.2, 0.3, 0),
    new BABYLON.Vector3(-1, 0, 0),
    new BABYLON.Vector3(-0.2, -0.3, 0),
    new BABYLON.Vector3(0, -1, 0),
    new BABYLON.Vector3(0.2, -0.3, 0),
    ];
shape.push(shape[0]);
                
//this doesn't work
var shapeline = BABYLON.MeshBuilder.CreateLines("sl", {points: shape}, scene);
                
//neither does this
//var shapeline = BABYLON.Mesh.CreateLines("sl", shape, scene);

..

The rest of the code is only the creation of a simple scene from the very basic Babylon getting started tutorial and is working fine when I remove the CreateLines.

Any ideas what I'm doing wrong?

Cheers,

Lesterhaus

 

Link to comment
Share on other sites

Thanks Deltakosh, switching to 2.4 fixed this issue! 

I feel stupid for not trying to switch to 2.4 myself - In the documentation I only found 2.3 classes which also included the MeshBuilder class and the CreateLines method so I guess I was too panicked to calmly check other sources for this.

 

Anyways, thanks a lot! 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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