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
6
votes
3 answers

Unity. Function call after a certain period of time

How can I make an object invisible (or just delete) after a certain period of time? Use NGUI. My example (for changes): public class scriptFlashingPressStart : MonoBehaviour { public GameObject off_Logo; public float dead_logo =…
user3114190
6
votes
2 answers

Touch Controls unity 2D

I have script called PlayerCharacter to control a player on the Unity 2D Platform. It's perfect, working as usual. using UnityEngine; using System.Collections; using System.Collections.Generic; [RequireComponent(typeof…
user3186627
  • 71
  • 1
  • 1
  • 6
6
votes
4 answers

Programming Unity Games with Ruby

So I see that unity has the support for c#, JS and Boo. I could learn one of these but I would like to make a 'compiler' or something similar that would let me write ruby code and either output JS code or make a layer that could be read by the Unity…
joncodo
  • 2,298
  • 6
  • 38
  • 74
6
votes
2 answers

TimeZone.CurrentTimeZone alternative

I'm using TimeZone.CurrentTimeZone to get user's time offset from UTC like so: TimeZone zone = TimeZone.CurrentTimeZone; TimeSpan offset = zone.GetUtcOffset(DateTime.Now); return offset.Hours*60+offset.Minutes; This works when I build for…
Stanley
  • 1,421
  • 5
  • 19
  • 36
6
votes
1 answer

Can't pass back event from Unity to android library jar

I am quite new at Unity and I am trying to create a Unity plugin for an Android library jar and I am facing the following issues: I can't find a way to pass the back button event to Android library. It seems that Unity prevents this event to be…
andreasv
  • 689
  • 3
  • 11
  • 26
6
votes
2 answers

Generate a real time 3D (mesh) model in Unity using Kinect

I'm currently developing an application with the initial goal of obtaining, in real time, a 3D model of the environment "seen" by a Kinect device. This information would be later on used for projection mapping but that's not an issue, for the…
user3019217
  • 335
  • 1
  • 5
  • 12
6
votes
1 answer

Nested Coroutines Using IEnumerator vs IEnumerable in Unity3d

I'm using the StartCoroutine method of Unity3D and I have a question concerning nested coroutines. Typically, nested coroutines might look something like this: void Start() { StartCoroutine(OuterCoroutine()); } IEnumerator OuterCoroutine() { …
Kyle G
  • 141
  • 3
  • 7
6
votes
3 answers

how to pass parameter to java method from c# in JNI

I am working in Unity3D and writing my script in C#. I want to call my java method from c# script which take a parameter of boolean type but i don't know how to pass parameter from C# using JNI. I am able to call methods which does not take any…
Kapil
  • 1,790
  • 1
  • 16
  • 32
6
votes
2 answers

accessing android jar in unity3d

I have an android project for camera flashlight, which when deployed from eclipse works fine. I am trying to access the flashlight function from my C# code in unity3d but it doesn't work. To verify if I am calling the android method correctly, I…
jainam
  • 363
  • 1
  • 6
  • 16
6
votes
2 answers

Running script before building on Unity

Is there a way to run a script method automatically before I build via File > Build Settings... > Build? I know I can make a menu item to call my method and call build afterwards.
Roberto
  • 11,557
  • 16
  • 54
  • 68
6
votes
6 answers

Unity3D -- Send message to other mobile phones in the same vicinity

Say we have a group of 10 people, within 20m of one another. Each person has a mobile phone (iPhone / android / Windows phone). And one person taps the screen to send a message. And this is instantly registered by the others. Synchronisation is the…
P i
  • 29,020
  • 36
  • 159
  • 267
6
votes
2 answers

Screen Recorder Android Plugin in Unity

I'm developing an Unity-Android Plugin to record game screen and create a mp4 video file.I follow to Android Breakout game recorder patch sample in this site : http://bigflake.com/mediacodec/. First, I create my CustomUnityPlayer class that extends…
6
votes
2 answers

How can I rotate a sprite in Unity 4.3?

I would like to rotate a sprite on the scene by pressing the left or right arrows keys (think of the spaceship in Asteroids). I have placed the sprite in question on the scene and created a script, but am not really certain of where to go from…
Sailing Judo
  • 11,083
  • 20
  • 66
  • 97
6
votes
5 answers

How to get user's profile picture with Facebook's Unity SDK?

I'm trying to get the profile pic of the user of the game using this- void MyPictureCallback(FBResult result) // store user profile pic { if (FB.IsLoggedIn) { WWW url = new WWW("http" + "://graph.facebook.com/" +…
Jason Pietka
  • 181
  • 1
  • 3
  • 16
6
votes
2 answers

Is it really wrong to use Input.GetKey() on FixedUpdate?

We know there's a "rule" that Input functions shouldn't be used inside the FixedUpdate(); Input.GetKeyDown() may not work if we do so, but is it really wrong to use Input.GetKey()? Let's say we want to fire something when pressing and holding a key…
Roberto
  • 11,557
  • 16
  • 54
  • 68