BabylonJs position X to Y animation

Hi everyone,

Help me Pls about Babylonjs animation. I have a file with babylon extension. I want this file to move as animation only in X and Z positions.

BABYLON.SceneLoader.ImportMesh(

            "",

            "/assets/",

            "file.babylon",

            scene,

            function (meshes) {

                let marketCar = scene.getMeshByName("MarketAraba");

                meshes[0].position.x = -123;

                meshes[0].position.y = 0;

                meshes[0].position.z = -21;

             meshes[0].scaling.scaleInPlace(10);

             const frameRate = 10;

             const xSlide = new BABYLON.Animation("xSlide", "position.x", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);

             const keyFrames = [];

                    keyFrames.push({

                        frame: 10,

                        value: 120

                    });
                    keyFrames.push({

                        frame: frameRate,

                        value: -160

                    });
                    keyFrames.push({

                        frame: 10 * frameRate, 

                        value: 112

                    });

                    xSlide.setKeys(keyFrames);
                    meshes[0].animations.push(xSlide);
                    scene.beginAnimation(meshes[0], 0, 3 * frameRate, true);

            });

Hey @saygidagerek

Welcome to the Babylon family! We’re happy to have you here!

As a general rule we ask people to please provide playground links for questions. This is the most helpful tool in answering questions. Can you create a playground pretty please?

Thanks!