# Help Adjusting Animation Speed

**URL:** https://discourse.threejs.org/t/help-adjusting-animation-speed/53284
**Category:** Questions
**Tags:** animation, threejs
**Created:** [June 27, 2023, 1:21pm UTC](https://discourse.threejs.org/t/help-adjusting-animation-speed/53284 "2023-06-27T13:21:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Daniyal\_H](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/daniyal_h/32/36766_2.png) [@Daniyal\_H](https://discourse.threejs.org/u/Daniyal_H)
#### Post date: [June 27, 2023, 1:21pm UTC](https://discourse.threejs.org/t/help-adjusting-animation-speed/53284/1 "2023-06-27T13:21:25Z")

</div>

Hello! I have created an animation through an unorthodox method of updating the position of an object from X,Y,Z values received in a CSV file and looped until reaching the end of the CSV. How would I be able to implement a feature for this animation to play at half or 3/4 speed?

---

<div class="post-metadata">

### Author: ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)
#### Post date: [June 27, 2023, 1:27pm UTC](https://discourse.threejs.org/t/help-adjusting-animation-speed/53284/2 "2023-06-27T13:27:46Z")

</div>

> [@Daniyal\_H](#):
>
> an unorthodox method

In order to get any help, we need to see this unorthodox method!

Otherwise, you may consider using [AnimeJS](https://animejs.com/) or [GreenSock](https://greensock.com/), at the price of few `ko` in bundle size, you’ll get better control over you animations.

---

<div class="post-metadata">

### Author: ![Daniyal\_H](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/daniyal_h/32/36766_2.png) [@Daniyal\_H](https://discourse.threejs.org/u/Daniyal_H)
#### Post date: [June 27, 2023, 1:29pm UTC](https://discourse.threejs.org/t/help-adjusting-animation-speed/53284/3 "2023-06-27T13:29:24Z")

</div>

Sorry here is the main function used to animate!

````javascript
function animate() {
            requestAnimationFrame(animate);

            if (dataIndex < convertedData.length && paused == false) {
                console.log(convertedData[dataIndex]);
                soccerBall.position.x = convertedData[dataIndex].x;
                soccerBall.position.y = convertedData[dataIndex].y;
                soccerBall.position.z = convertedData[dataIndex].z;
                soccerBall.rotation.y += 1;
                soccerBall.rotation.z += 1;
                if (trailsEnabled == true){
                    trailMesh = new THREE.Mesh(trailGeometry,trailMaterial);
                    trailMesh.rotateX(1.5708);
                    trailMesh.position.x = convertedData[dataIndex].x;
                    trailMesh.position.y = convertedData[dataIndex].y;
                    trailMesh.position.z = convertedData[dataIndex].z-50;
                    trailObjects.push(trailMesh);
                    scene.add(trailMesh);
                }
                dataIndex++;
            }```
````

---

<div class="post-metadata">

### Author: ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)
#### Post date: [June 27, 2023, 1:35pm UTC](https://discourse.threejs.org/t/help-adjusting-animation-speed/53284/4 "2023-06-27T13:35:58Z")

</div>

Check this [example](https://jsfiddle.net/7u84j6kp/), the animation method has a `time` param.

```javascript
function animation( time ) {
	mesh.rotation.x = time / 2000;
	mesh.rotation.y = time / 1000;

	renderer.render( scene, camera );
}

```

You can do the same with your method, tweak it till you get the desired speed.
