---
title: "Translate and Rotate"
content_type: tutorial
url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate?language=en"
language: en
container_type: course
container_title: "Beginner Scripting"
container_url: "https://learn.unity.com/course/beginner-scripting.md?language=en&version=2019.3"
standalone_markdown_url: "https://learn.unity.com/tutorial/translate-and-rotate.md?language=en&version=2019.3"
previous_title: "Activating GameObjects"
previous_url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects?language=en&version=2019.3"
previous_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2019.3"
next_title: "Look At"
next_url: "https://learn.unity.com/course/beginner-scripting/tutorial/look-at-s?language=en&version=2019.3"
next_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/look-at-s.md?language=en&version=2019.3"
difficulty: beginner
duration_minutes: 5
unity_version:
  - "2019.3"
  - "2019.2"
  - "2019.1"
  - "2018.4"
  - "2018.3"
  - "2018.2"
  - "2018.1"
  - "2017.4"
  - "2017.3"
  - "2017.2"
  - "2017.1"
  - "5.x"
  - "4.x"
supported_unity_versions:
  - name: "2019.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2019.1"
  - name: "2018.4"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2018.4"
  - name: "2018.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2018.3"
  - name: "2018.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2018.2"
  - name: "2018.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2018.1"
  - name: "2017.4"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2017.4"
  - name: "2017.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2017.3"
  - name: "2017.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2017.2"
  - name: "2017.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2017.1"
  - name: "5.x"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=5.x"
  - name: "4.x"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=4.x"
last_updated: "2026-08-04T14:22:55.000Z"
---

# Translate and Rotate

Practice using the Transform functions Translate and Rotate to change a non-Rigidbody GameObject’s position and rotation in a script.

How to use the two transform functions Translate and Rotate to effect a non-rigidbody object's position and rotation.

This tutorial is included in the [Beginner Scripting project](https://learn.unity.com/project/beginner-gameplay-scripting).

Previous: [Activating GameObjects](https://learn.unity.com/tutorial/activating-gameobjects?projectId=5c8920b4edbc2a113b6bc26a)

Next: [Look At](https://learn.unity.com/tutorial/look-at-s?projectId=5c8920b4edbc2a113b6bc26a)

## 1. Translate and Rotate

[Video](https://connect-mediagw.unity.com/h1/20220104/videos/c9e33edc-762a-4106-b27b-e0ae6d7c9f33_U_Beginner_12_TranslateandRotate.mp4)

## **TransformFunctions**

```csharp
using UnityEngine;
using System.Collections;

public class TransformFunctions : MonoBehaviour
{
    public float moveSpeed = 10f;
    public float turnSpeed = 50f;
    
    
    void Update ()
    {
        if(Input.GetKey(KeyCode.UpArrow))
            transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
        
        if(Input.GetKey(KeyCode.DownArrow))
            transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);
        
        if(Input.GetKey(KeyCode.LeftArrow))
            transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);
        
        if(Input.GetKey(KeyCode.RightArrow))
            transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
    }
}
```
