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
48
votes
2 answers

Why float.Epsilon and not zero?

In the following code, why is there a comparison against float.Epsilon and not 0? // Coroutine to move elements protected IEnumerator SmoothMovement (Vector3 end) { // Distance computation float sqrRemainingDistance = (transform.position -…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
48
votes
4 answers

Understanding scenes in Unity3d

I have some confusion with scenes in Unity3d and I was not able to find any resources about them. When should scenes be used? For example in a platformer would every level have to be a different scene? Would the main menu be a scene? Can one…
user2853108
  • 1,291
  • 3
  • 12
  • 15
45
votes
1 answer

Why is Unity ignoring the initialized value of a non-static public field?

I'm using InvokeRepeating() to call a method in a game. I call InvokeRepeating() in the Start() method of one of the GameObject classes. To set the repeatRate parameter for InvokeRepeating(), I am passing it a public field called…
user3956566
44
votes
12 answers

Can't add script component because the script class cannot be found?

Yesterday I updated unity from unity5 to 2018.2.2f1. Unity scripts are not loading after Update 2018.2.2f1. Once I try to play the Scene the scripts are not loaded and I can't add the script again it gives this error: Can't add script component…
Joe
  • 879
  • 3
  • 14
  • 37
44
votes
4 answers

Getting "giggly" effect when slowly moving a sprite

How do I remove this "giggly" effect when slowly moving a sprite? I have tried adjusting Antialiasing values in QualitySettings and Filter Mode in ImportSettings in the Unity Editor but that doesn't change anything. Ideally, I would like to keep…
user5655032
44
votes
6 answers

Can I program in C# on a Mac?

I want to learn C# for Unity and my personal computer is a MacBook Air. Can I program in C# on a Mac?
firat
  • 567
  • 1
  • 4
  • 4
43
votes
9 answers

Reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found

I try to open a Unity3D project with VSCode under Linux (Ubuntu 18.10). The omnisharp extension doesn't load the project, saying assemblies were not found. It may seems very stupide, but i'm not really used to .Net yet, and i have been stuck with…
Eyap
  • 754
  • 1
  • 7
  • 22
42
votes
4 answers

Using new Unity VideoPlayer and VideoClip API to play video

MovieTexture is finally deprecated after Unity 5.6.0b1 release and new API that plays video on both Desktop and Mobile devices is now released. VideoPlayer and VideoClip can be used to play video and retrieve texture for each frame if needed. I've…
Programmer
  • 121,791
  • 22
  • 236
  • 328
42
votes
8 answers

Working with Unity3D and Visual Studio 2013

how do i get Unity3D for debugging the code, and Visual Studio 2013 which i have now to only script the code. Example: Like Flash Professional for debugging and FlashDevelop for scripting only. My question is, how do i get the Unity3D link with…
Kaoru
  • 2,853
  • 14
  • 34
  • 68
41
votes
11 answers

APKs or App Bundles are available to 64-bit devices but they only have 32-bit native code

I have exported an Android App Bundle file to upload at Play store with NDK downloaded from Unity desired location because Android Studio NDK file is not compatible with Unity. I got this kind of error message when I upload the build: Here you…
Siddharth
  • 4,142
  • 9
  • 44
  • 90
41
votes
8 answers

NuGet packages in Unity

I want to use some NuGet packages inside Unity. I achieved that Unity finds the downloaded DLLs according to this article (https://www.what-could-possibly-go-wrong.com/unity-and-nuget/). The nuget.config file can be configured to download the…
40
votes
4 answers

Sending http requests in C# with Unity

How can I send HTTP GET and POST requests in C# with Unity? What I want is: send json data in post request (I use Unity serializer, so no need in new one, I just want to pass string in post data and have ability to set ContentType to…
Kamo Spertsian
  • 785
  • 2
  • 8
  • 23
40
votes
4 answers

In unity3D, Click = Touch?

I want to detect click/touch event on my gameObject 2D. And this is my code: void Update() { if (Input.touchCount > 0) { Debug.Log("Touch"); } } Debug.Log("Touch"); does not show when I click on screen or my gameObject.
Lnitus
  • 409
  • 1
  • 4
  • 5
40
votes
21 answers

Debugging with unity

At the current moment, what I'm doing is that I'm opening Unity, double click on one of those scripts I've written, then MonoDevelop gets opened, now I have to close unity and in MonoDevelop I do Run >> Run with >> Unity Debugger. After this Unity…
smallB
  • 16,662
  • 33
  • 107
  • 151
39
votes
6 answers

Unity - How to stop Play Mode in case of infinite loop?

I just made a silly mistake and I ended up with an infinite loop inside my Update(). After that I wasn´t able to stop the Play Mode. Actually I wasn´t able to do anything else with Unity until I restarted it. My question is, does anyone know how to…
Ignacio Alorre
  • 7,307
  • 8
  • 57
  • 94