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.

Unity is a cross-platform game engine with a built-in IDE. It is used to develop video games, kiosks and simulations for web plugins, desktop platforms, consoles, and mobile devices.

It supports code written in C# which is compiled using the Mono framework or IL2CPP.

Previous versions also supported UnityScript (a JavaScript-like language) or Boo (Python-like), but those languages have been deprecated in recent Unity versions.

16786 questions
111
votes
2 answers

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 metaball effect. How can I replicate this effect,…
Seyed Morteza Kamali
  • 8,383
  • 13
  • 56
  • 86
109
votes
6 answers

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 using PlayerPrefs , while other people told me this…
Enrique Moreno Tent
  • 2,038
  • 5
  • 23
  • 33
93
votes
3 answers

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, because they're always in a sleeping physics state,…
Garflington
  • 137
  • 2
  • 10
  • 25
81
votes
13 answers

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 zillion ways to do it, all seem to have gotcha's and…
Michael
  • 911
  • 1
  • 7
  • 4
79
votes
10 answers

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 and validating a singleton. Is there a correct, or rather, preferred approach to…
Zack Brown
  • 967
  • 4
  • 19
  • 30
76
votes
1 answer

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?
Seyed Morteza Kamali
  • 8,383
  • 13
  • 56
  • 86
69
votes
1 answer

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 YouTube :
Seyed Morteza Kamali
  • 8,383
  • 13
  • 56
  • 86
65
votes
6 answers

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

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, I even heard Google is going to implement it in…
jokoon
  • 4,801
  • 9
  • 43
  • 61
49
votes
4 answers

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, which can be easily reverse engineered, so is there a…
TheBinaryGuy
  • 646
  • 1
  • 5
  • 11
46
votes
2 answers

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 be wrong but it looks like it even has a…
Daniel
  • 3,491
  • 9
  • 38
  • 55
43
votes
4 answers

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 question is what will happen when the value of time…
Yaroslav
  • 771
  • 2
  • 10
  • 18
42
votes
1 answer

Why use convex polygons and not concave ones in path-finding?

I read in Unity's path-finding documentation that they use convex polygons because there won't be any 'obstruction' between 2 points. Then they add their vertices as nodes along with starting and ending points and traverse them using A* algorithm to…
Rany
  • 473
  • 4
  • 7
42
votes
4 answers

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 continues to render a loading screen to indicate…
DarkDestry
  • 1,441
  • 4
  • 18
  • 26
40
votes
7 answers

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 looking to support up to 10^500; that needs to be…
MathHelp
  • 419
  • 1
  • 4
  • 4
38
votes
2 answers

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 platform, instead of falling down when reaching…
pyko
  • 493
  • 1
  • 5
  • 8
1
2 3
…
99 100