---
title: "Conventions and Syntax"
content_type: tutorial
url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting/tutorial/conventions-and-syntax?language=en"
language: en
container_type: course
container_title: "Beginner Scripting"
container_url: "https://learn.unity.com/course/beginner-scripting-old.md?language=en"
unit_title: "Beginner Scripting"
unit_url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting?language=en"
standalone_markdown_url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en"
previous_title: "Variables and Functions"
previous_url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting/tutorial/variables-and-functions?language=en"
previous_markdown_url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting/tutorial/variables-and-functions.md?language=en"
next_title: "IF Statements"
next_url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting/tutorial/if-statements?language=en"
next_markdown_url: "https://learn.unity.com/course/beginner-scripting-old/unit/beginner-scripting/tutorial/if-statements.md?language=en"
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/tutorial/conventions-and-syntax.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2019.1"
  - name: "2018.4"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2018.4"
  - name: "2018.3"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2018.3"
  - name: "2018.2"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2018.2"
  - name: "2018.1"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2018.1"
  - name: "2017.4"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2017.4"
  - name: "2017.3"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2017.3"
  - name: "2017.2"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2017.2"
  - name: "2017.1"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=2017.1"
  - name: "5.x"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=5.x"
  - name: "4.x"
    url: "https://learn.unity.com/tutorial/conventions-and-syntax.md?language=en&version=4.x"
last_updated: "2026-09-30T20:33:54.000Z"
---

# Conventions and Syntax

Review basic C# coding conventions, including dot operators, semicolons, indentation, and comments, in the Beginner Scripting project.

Learn about some basic conventions and syntax of writing code - dot operators, semi-colons, indentation and commenting.

Previous: [Variables and Functions](https://learn.unity.com/tutorial/variables-and-functions?projectId=5c8920b4edbc2a113b6bc26a)

Next: [If Statements](https://learn.unity.com/tutorial/if-statements?projectId=5c8920b4edbc2a113b6bc26a)

## 1. Conventions and Syntax

[Video](https://connect-mediagw.unity.com/h1/20220104/videos/b0b3147a-7cfb-41c3-bb44-b938a81fbc08_U_Beginner_3_ConventionsandSyntax.mp4) ([Transcript (en)](https://connect-mediagw.unity.com/h1/20220104/6627e6e8-befe-47c6-8bea-9f9f214b0daf_B_03_Conventions_and_Syntax_AudioProcessed.vtt))

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

public class BasicSyntax : MonoBehaviour
{
    void Start ()
    {
        //this line is there to tell me the x position of my object

        /*Hi there!
         * this is two lines!
         * */
        Debug.Log(transform.position.x);
        
        if(transform.position.y <= 5f)
        {
            Debug.Log ("I'm about to hit the ground!");
        }
    }
}
```
