Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unity]

Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

97
votes
1answer
13k views

How can I create a “see behind walls” effect?

Divinity: Original Sin 2 has a beautiful see-through system. When I go behind walls, a splash mask will appear, and when I move around the game, it changes. It's like a dissolve shader, and has a ...
90
votes
3answers
14k views

How can I clean up excessive player-created rubble?

In my latest game I'm making, you can slice a 2D object arbitrarily, demonstrated in this gif: You can continuously cut it into hundreds or thousands of pieces. This doesn't create a lot of lag, ...
69
votes
1answer
7k views

How can I make a “wet surface”/“shallow puddle” shader in Unity?

In my game I need to create dynamic water puddles but I cannot find a tutorial that shows how I can make such an effect (an example of which is shown below). How can I do it?
67
votes
1answer
7k views

How can I replicate Quantum Break's distortion particle effect?

Quantum Break has this fantastic particle effect, it's a distortion effect like broken glass. I want know how I can replicate this effect? You can see it below, and a full video is available on ...
65
votes
6answers
63k views

What are the pro/cons of Unity3D as a choice to make games? [closed]

We are doing our school project with Unity3d, since they were using Shiva the previous year (which seems horrible to me), and I wanted to know your point of view for this tool. Pros: multi platform, ...
63
votes
12answers
67k views

How do you handle aspect ratio differences with Unity 2D?

I've gotten a lot of answers to this question, but they are all generic and generally not very useful. None of the tutorials talk about aspect ratio and dealing with mobile devices and there are a ...
47
votes
4answers
13k views

How can I completely hide and protect strings from the player in Unity?

I have been using Unity to create a 2D game which will be completely offline (which is the problem), the game-play needs you to enter certain strings at certain levels and Unity compiles to DLLs, ...
45
votes
2answers
8k views

How to render realistic ice?

I am trying to write an ice shader in Unity that looks good and at least semi-realistic. If the following shot (found on Google) was CG, what would its shader include? (the foreground cave). I might ...
40
votes
4answers
47k views

Unity 5 - What is the proper way to handle data between scenes?

I am developing my first 2D game in Unity and I have come across what seems an important question. How do I handle data between scenes? There seems to be different answers to this: Someone mention ...
35
votes
9answers
22k views

I prefer C/C++ over Unity and other tools: is it such a big downer for a game developer? [closed]

We have a big game project using Unity at school. There are 12 of us working on it. My teacher seems to be convinced it's an important tool to teach students, since it makes students look from the ...
35
votes
8answers
13k views

Should I avoid using object inheritance as possible to develop a game?

I prefer OOP features when developing games with Unity. I usually create a base class (mostly abstracted) and use object inheritance to share the same functionality to the various other objects. ...
35
votes
4answers
9k views

What happens when Time.time gets very large in Unity?

As it is said here : Time.time The time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game. And as I know the time is stored in float. So, my ...
32
votes
2answers
8k views

How do I make a character capable of walking on walls?

I am trying to get a character to move like a spider: Given a rising slope which a ball would normally not be able to roll up, the spider would slowly crawl up. Similarly, given a mid-air rectangular ...
30
votes
6answers
41k views

What is the most serious limitation of Unity? [closed]

Having read this heated question about Unity vs. UDK vs. ID something, I'm curious to know: what the repeatedly-hit, most crippling limitation(s) of Unity? In order to keep this question non-...
30
votes
7answers
12k views

Teamwork in Unity

I have a Unity project without any version control, and I need to share it with another developer so that both of us can work on the project. What strategies should be use that play nice with Unity ...
29
votes
6answers
54k views

Can I legally remove the default Unity splash screen by removing it from the APK?

While using Unity I export an Android game as an APK. When the APK is run, the first thing that is displayed is the Unity splash screen. I worked out that I could replaced that image by opening the ...
29
votes
3answers
32k views

What happens if I make more than $100k with the free Unity license?

If an indie game developer makes more than $100,000 using the free version of Unity, what happens to the money that goes over $100k? How will Unity people come to know how much money they are making? ...
27
votes
6answers
17k views

How do idle games handle such large numbers?

Just wondering how games such as Tap titans and Cookie Clicker handle such large numbers. I am trying to implement an idle game however the largest number format supported by C# is decimal. I am ...
27
votes
4answers
27k views

How do you save game state?

What is the procedure followed by game programmers for saving and resuming game state? like files/mappings. I want to save it for tower defense game and I am using unity3D game engine.
26
votes
8answers
27k views

Algorithm for creating spheres?

Does anyone have an algorithm for creating a sphere proceduraly with la amount of latitude lines, lo amount of longitude lines, ...
26
votes
1answer
2k views

How do I run functional tests against my Unity3D game?

Context I am continuing some legacy code for a game in Unity3d, and I want to write some functional tests meant for regression, to ensure I don't break things when implementing new things or when ...
25
votes
5answers
14k views

Why is an engine like Unity3D emphasized over a native library like OpenGL for beginners? [closed]

I am just a beginner in 3D games, my preferred platform is Android. I posted a question in some other forum about "What to use: OpenGL or Unity3d?" They all emphasized Unity3D and using its built-in ...
25
votes
9answers
17k views

Best place for learning how to write games in Unity3d [closed]

What's the best place for tutorials & other learning resources for unity3d?
25
votes
2answers
49k views

How to correctly draw a line in Unity

I'm working on a game which requires me to draw a few lines from a single point that is more formally said Given point A with coordinates x,y I draw n lines where the i-th line has the coordinates ...
25
votes
4answers
42k views

How to not freeze the main thread in Unity?

I have a level generation algorithm that is computationally heavy. As such, calling it always results in the game screen freezing. How can I place the function on a second thread while the game still ...
25
votes
3answers
3k views

How can I rotate an object based on another's offset to it?

I have a 3D model of a turret that con rotate around the Y-axis. This turret has a cannon that is significantly off the center of the object. I want the cannon, not the turret, to aim at a specified ...
24
votes
1answer
4k views

Why should I always consider creating and using object pools instead of instantiating the new object on the fly?

I have read about this pattern several times (from a best-practices perspective): Memory Allocation: Instead of instantiating the new object on the fly, always consider creating and using object ...
24
votes
2answers
4k views

Using Quaternions: What can I do with them? (without the maths)

I am a Game Developer and did not study Mathematics. So I only want to use Quaternions as a tool. And to be able to work with 3D rotation, it's necessary to use Quaternions (Or Matrixes, but let's ...
24
votes
7answers
8k views

How can I avoid tight script coupling in Unity?

Some time ago I started working with Unity and I still struggle with the issue of tightly coupled scripts. How can I structure my code to avoid this problem? For example: I want to have health and ...
23
votes
10answers
48k views

In Unity, how do I correctly implement the singleton pattern?

I have seen several videos and tutorials for creating singleton objects in Unity, mainly for a GameManager, that appear to use different approaches to instantiating ...
23
votes
2answers
9k views

How can I reduce the performance impact of rendering trees?

I'm making a low poly stylized kind of game. I have a terrain with some water, and I want lots and lots of trees; I have 10,000 trees mass placed, at the moment. Each tree consists no more than 200 ...
23
votes
4answers
8k views

Saving player's progress in a Unity game

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know ...
22
votes
5answers
11k views

How can I make particles glow and cast light on its surroundings?

Im currently attempting to make a firefly effect on a dark forest. The level has very low light and the player is one of the few light sources. To let the player see the level better, I am attempting ...
22
votes
3answers
7k views

How can I model a star?

I'm trying to model a star in Unity, and it, sort of works, but it's not ideal. Currently, I'm using a large sphere with a self-illuminating material containing a star texture applied to it's surface, ...
22
votes
2answers
45k views

What is the pixels to units property in Unity sprites used for?

I'm starting to learn Unity for 2D development. So, I am importing several sprites into the game, and I couldn't help but notice that there is a "pixels to units" property, by default on ...
22
votes
2answers
4k views

How can I implement a short-cut grass effect?

I've been looking at some screenshots from games like Rocket League and FIFA: and I started wondering one would achieve the short-cut grass effect. Is it a shader? Is it actual geometry? Or just ...
21
votes
4answers
11k views

How can I build a game in Unity with minimum/no use of the visual editor?

I'd like to write a game completely in C#. In my search for an engine, I found Unity3D, but all the tutorials and documentation are speaking about a visual editor and the Unity IDE in which you click ...
21
votes
3answers
5k views

How can I create a stretchy, breakable pizza cheese material?

I want to create realistic pizza and allow user interact with it. What I want: What I created: I created model of the pizza (8 pieces) in Blender, then imported it into Unity. The piece of pizza ...
21
votes
4answers
5k views

Should a wall be created as a plane or as a box?

What are the benefits of a wall being as a plane or as a box? Should I use a plane with a box collider instead of mesh collider?
20
votes
3answers
16k views

What's the difference between UnityEngine.Random and System.Random?

What's the different between this int randomNumber = UnityEngine.Random.Range(0, 10); and this ...
20
votes
2answers
3k views

Faking a 3D object to decrease number of polygons

I'm making a game in unity and I'm building a fence in blender but I want it to be as low poly as possible. My original design was too high poly so I thought, what if I could simply use a cube with ...
20
votes
1answer
1k views

Why do I seem to lose control of my computer when full screen Unity game loses focus?

When I press Ctrl+Alt+Esc or Ctrl+Shift+Esc the game loses focus, but then the whole PC is unusable and I need to restart the PC to regain control How do I prevent the computer from locking up (let ...
20
votes
2answers
4k views

Unity Method count exceed the limit of 64K

I just got an issue related to a 64k method in Unity so that's why I'm unable to build my project. It shows method limitation exceed the limit of 64k method count. So can anyone here help me out to ...
19
votes
1answer
4k views

What is wrong with my Respawn coroutine?

I am creating a 2D Platformer game in which if the player falls off the base/ground then I want the player to respawn at the nearest checkpoint. However I want there to be a delay between the player ...
19
votes
5answers
33k views

How can I make huge terrains in Unity?

How can I make extremely huge terrains in Unity? It seems like I can set width and length to large values. But the Heightmap resolution only goes up to 4097 and the Detail resolution only goes up to ...
19
votes
2answers
71k views

Is it possible to use C++ with Unity instead of C#?

The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity?
19
votes
2answers
23k views

What is the difference between Unity's Sprite and Texture2D classes?

Unity has both a Texture2D class and a Sprite (with related SpriteRenderer). What is the ...
19
votes
1answer
2k views

How do I render my 3D game in ASCII art?

I'm trying to create an Easter egg for a 3D game in Unity3D. I want to render my game momentarily in ASCII art. My first idea is to create a shader to do that, but I'm not sure if it's the right way.
18
votes
2answers
5k views

“The Object you want to Instantiate is null” But it works, can I ignore the error?

This has never happened to me so I'm a bit confused. GameObject someObject = Instantiate (Resources.Load ("Prefabs/Items/" + someName)) as GameObject; This ...
18
votes
5answers
8k views

Are huge, static objects like environment transmitted from server to client in modern multiplayer games?

I have an authoritative system, where when the player joins the match, it gets all the already spawned objects - spawned on itself (the client). It looks like this: ...