lesterhaus Posted April 18, 2016 Share Posted April 18, 2016 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 Quote Link to comment Share on other sites More sharing options...
Numa Posted April 18, 2016 Share Posted April 18, 2016 Could you post the complete code? I pasted your code inside of mine and it worked fine Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 19, 2016 Share Posted April 19, 2016 I think the issue comes from the version of babylon.js (you should use babylonjs 2.4 to get this new feature) lesterhaus 1 Quote Link to comment Share on other sites More sharing options...
lesterhaus Posted April 19, 2016 Author Share Posted April 19, 2016 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! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 19, 2016 Share Posted April 19, 2016 My pleasure! 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.