---
name: "Animation.translateZ"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "Animation.translateZ - 对 Z 轴平移"
---

## Animation.translateZ

> [VERSION] Base Library >= 2.21.8

### Description

Translate along the Z axis

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `translateZ` | `number` | No | Translation distance on the Z axis, in px |

### Return Value

Type: `Animation`

Animation instance

### Examples

#### Z-axis translation

```ts
Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.translateZ(50).step();
    this.setData({ animationData: animation.export() });
  },
});
```
