Documentation

Unity Engine

Download Unity

Unity Engine

Get started with programming in Unity

Create, name, and inspect your first Unity scripts, and learn the fundamental C# types that Unity provides.
Read time 1 minuteLast updated 3 days ago

Unity uses C# scripts to define the behavior of your application and to extend the Unity Editor. Understand how scripts work, learn what C# types are fundamental in Unity, and follow programming best practices to implement functionality to your application. Create scripts with appropriate names and use them alongside the
Inspector

?

window.
To set up your code editor and other development tools, refer to Environment setup.

Topic

Description

Introduction to programming in UnityUnderstand the role of scripting in your project and how it works at a high level.
Script file names and namespacesUnderstand how Unity matches script file names to class names, and use namespaces to prevent class name conflicts.
Create scriptsCreate C# script assets from the Editor to add custom functionality to your application.
Scripts in the Inspector windowView script assets in the Inspector window and edit the fields of your script components.
Migrate from InstanceID to EntityIdUpdate code that uses
InstanceID
-based APIs to the
EntityId
APIs that Unity uses to identify objects.
Unity programming best practicesLearn key issues to be aware of when writing code for Unity applications, along with best practices to help you avoid common pitfalls.
Unity scripting typesUnderstand some of the fundamental C# types that Unity provides and their special significance and behavior in the Unity Editor and runtime.

Additional resources