About meshes position

hii everyone i am trying to change the mesh position but it is not change why
createcamera() {

this.scene.createDefaultCameraOrLight(true, true, true);
// this.camera = this.scene.getCameraById('defaultCamera');
this.camera = new ArcRotateCamera("camera", 3 * Math.PI / 8, 3 * Math.PI / 8, 15, new Vector3(0, 0, -10), this.scene);
this.camera.attachControl(this.threedpreview.nativeElement, true)
this.camera.wheelPrecision = 100;

}
SceneLoader.ImportMeshAsync(“”,
“./assets/models/”,
meshUrl, this.scene).then((frame) => {
// frame.meshes[0].position.z = -0.9;
this.scene.createDefaultCamera(true, true, true);
this.meshes = frame.meshes;
this.meshes.position = new Vector3(0,0,-0.9);
console.log(this.meshes);

Hi and welcome to the Community,
I allowed myself to move your topic to the ‘questions’ category for now (as I believe this is not an identified bug). Also for faster and more accurate answers, I would recommend you share a PG with us.

I will let someone from the Team answer your question as I am not sure to spot the error just like that within your small script extract.
Shouldn’t be all too long… Meanwhile, again, welcome to the forum and have a great day :sunglasses:

We definitely need to see a playground here. Also check your console for any errors.

frame.meshes is not a mesh but an array. It does not have a position.
The correct way to write it is probably:
this.mesh = frame.meshes[0];
this.mesh.position = new Vector3(0,0,-0.9);

1 Like

Oh, nice one. :+1: I’m glad to see that there are others actually taking the time to read the code and make assumptions from there (and then, very likely to be the correct one :smiley:) Looks like I still do not have enough patience for that. But then, a PG is still the best way to go (in my opinion).

playground sharing pages is certainly the most efficient way, but I guess he can’t use playground yet and will need time to learn. :smiling_face_with_tear:

Well, it’s fairly easy. Even me, with my designers’ small-brain :brain: managed to use it :wink:
The hardest part is about importing external assets. One would eventually need to create an account to import from a ‘reliable’ source.
But the PG is not only a great tool for sharing and debugging. I use it all the time to accelerate dev.
For example, just now, I’m creating a wheel-type GUI from the gui editor. Working it in my scene would take me at least twice the time then first sketching it in the PG. Once I’m done, I just copy everything to my scene and it works like magic :magic_wand: :smile:

1 Like