Questions tagged [unity-game-engine]

Unity is a cross-platform game engine by Unity Technologies. Questions should be about programming with the game engine and not usage of the graphical interface. Questions about the usage of the graphics interface are off topic.

Unity logo

Unity is a game engine, IDE and service suite developed by Unity Technologies. As of 2016 it is the most widely-used game development system.

It targets mobiles, desktops, consoles, web browsers, and VR devices. Unity is used for 3D, 2D and VR/AR. Cloud services include advertising, in-app purchase, and cloud building. The Unity application itself is for both Windows and macOS.

In Unity, components are written in C# and are usually compiled using Mono or IL2CPP.

Major subsystems include PhysX game physics, Mecanim animation, a third-party asset store, and Unity.UI.

Note that although "Unity" is the product name and "unity.com" is the web site, on stackoverflow.com "unity-game-engine" is the tag for Unity.

Latest release: Release 2022.2.9 released on the 3rd of March 2023.

The latest update supports development for the following:

Mobile

  • iOS
  • Android

VR and AR

  • Oculus
  • Google Cardboard
  • Steam VR
  • PlayStation VR
  • Gear VR
  • Microsoft Hololens
  • Daydream
  • Apple ARKit
  • Google ARCore
  • Magic Leap
  • Vuforia

Desktop

  • Windows
  • Universal Windows Platform
  • macOS
  • Linux / Steam OS
  • Facebook Gameroom

Console

  • PlayStation 4
  • Xbox One
  • Nintendo Switch
  • Nintendo 3DS family of systems

Web

  • WebGL

Smart TVs

  • Android TV
  • Apple TV
  • tvOS

Useful links


Related tags

75302 questions
567
votes
18 answers

How to use Git for Unity3D source control?

What are best practices for using Git source control with Unity 3D, particularly in dealing with the binary nature of Unity 3D projects? Please describe the workflow, what paths would be included in .gitignore, what settings should be set in Unity…
PressingOnAlways
  • 11,948
  • 6
  • 32
  • 59
358
votes
36 answers

Unity Scripts edited in Visual studio don't provide autocomplete

When I want to edit C# Unity scripts, they open in Visual Studio. It is supposed to provide auto complete for all Unity related code, but it doesn't work. Here you can see the missing functionality: As seen, the transform object does not open the…
CorbenDalas
  • 3,743
  • 3
  • 9
  • 7
185
votes
2 answers

How to prepare a Unity project for git (step-by-step)?

What are the detailed steps necessary to prepare a Unity project for committing to a git repository eg. github? I don't want to store unnecessary files (specially temp files and avoid binary formats as much as possible) and I would appreciate a…
German
  • 10,263
  • 4
  • 40
  • 56
154
votes
7 answers

How does StartCoroutine / yield return pattern really work in Unity?

I understand the principle of coroutines. I know how to get the standard StartCoroutine / yield return pattern to work in C# in Unity, e.g. invoke a method returning IEnumerator via StartCoroutine and in that method do something, do yield return…
Ghopper21
  • 10,287
  • 10
  • 63
  • 92
144
votes
10 answers

Serialize and Deserialize Json and Json Array in Unity

I have a list of items send from a PHP file to unity using WWW. The WWW.text looks like: [ { "playerId": "1", "playerLoc": "Powai" }, { "playerId": "2", "playerLoc": "Andheri" }, { …
dil33pm
  • 1,613
  • 2
  • 13
  • 18
120
votes
7 answers

what is the difference between Update & FixedUpdate in Unity?

What is the difference between the Update and FixedUpdate methods, and when should these methods be used?
Kapil11
  • 1,355
  • 2
  • 9
  • 6
111
votes
4 answers

How to detect click/touch events on UI and GameObjects

How to detect UI object on Canvas on Touch in android? For example, I have a canvas that have 5 objects such as Image, RawImage, Buttons, InputField and so on. When I touch on Button UI object Then do something. Each button do different process when…
Dennis Liu
  • 2,268
  • 3
  • 21
  • 43
97
votes
8 answers

How to make the script wait/sleep in a simple way in unity

How can I put a sleep function between the TextUI.text = ...., to wait 3 seconds between each phrase? public Text GuessUI; public Text TextUI; [...truncated...] TextUI.text = "Welcome to Number Wizard!"; TextUI.text = ("The highest number you can…
DiogoSaraiva
  • 1,515
  • 2
  • 15
  • 19
93
votes
6 answers

How to pass data (and references) between scenes in Unity

How can I pass score value from one scene to another? I've tried the following: Scene one: void Start () { score = 0; updateScoreView (); StartCoroutine (DelayLoadlevel(20)); } public void updateScoreView(){ score_text.text = "The…
Mina Fawzy
  • 20,852
  • 17
  • 133
  • 156
89
votes
5 answers

Awake() and Start()

I see that we can initialize Variable in Awake() or Start() and Awake() will be called before Start(). When should we initialize in Awake and Start to have the best performance?
mdtuyen
  • 4,470
  • 5
  • 28
  • 50
89
votes
1 answer

"A namespace cannot directly contain members such as fields or methods"

I am trying to use this code for NET.reflector using Reflexil. I am trying to replace code with this: if(Input.GetKeyDown(KeyCode.Keypad5)) { int i = 0; Character localPlayer = PlayerClient.GetLocalPlayer().controllable.GetComponent();…
user3204732
  • 903
  • 1
  • 6
  • 4
86
votes
11 answers

not finding android sdk (Unity)

Error: Invalid command android UnityEditor.HostView:OnGUI() CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. C:/Program…
Salman Khan
  • 895
  • 1
  • 8
  • 18
83
votes
1 answer

How to resolve SmartFoxServer connection error in unity

I'm using SmartFoxServer API on Unity3d. It was working fine before I recovered my MacBook, but now gives a connection error as below: Http error creating http connection: System.Net.Sockets.SocketException: Connection refused at…
Muhammet Demir
  • 1,995
  • 5
  • 21
  • 42
82
votes
12 answers

What Language is Used To Develop Using Unity

What language does one need to use when programming with Unity? Or is it an API for many languages? I read through the docs and I guess I missed the point on the language used. It says it has iOS deployment, would this still allow the programmer to…
some_id
  • 29,466
  • 62
  • 182
  • 304
78
votes
4 answers

Ignoring folder meta files on version control

Unity creates and deletes meta files for folders inside the Asset folder. That can create an annoying situation when using version control (that you can skip and go to the questions): someone creates a folder of files that will be ignored but forget…
Roberto
  • 11,557
  • 16
  • 54
  • 68
1
2 3
99 100