Problems caused by path3D

Hi~
I’m getting an error message in my code, what’s causing this?
Is there a solution?

Hello :slight_smile:

Problem is on line 45 var path3d = new BABYLON.Path3D(pointsList);
The var pointsList should be an array of Vector3 (doc)
While you are sending a list of objects

{
    "_isDirty": true,
    "_x": -19.66522,
    "_y": 1.9260105893019248,
    "_z": 0.557011
},

You need to fix this :

var pts = [];
pointsList.forEach(function(pt){
    pts.push(new BABYLON.Vector3(pt["_x"], pt["_y"], pt["_z"]));
})
var path3d = new BABYLON.Path3D(pts);

Playground
(Following code is commented since it was triggering other bugs, I let you try to debug)

++
Tricotou

2 Likes

Thanks for the heads up. After dealing with the problem here, I reproduced the actual problem that occurs on my project, he seems to be animated, can you help me locate the problem?

Resolved. Thank you very much.