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.

Filter by
Sorted by
Tagged 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
5k 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
2answers
26k views

How to edit key-value pairs (like a Dictionary) in Unity's inspector?

I have a spell system I am creating, the principle is as follows: Each spell is an autonomous prefab. It contains a script with some properties (base damage, duration...) that can be modified in the ...
19
votes
2answers
31k views

Difference between unity scripting backend IL2CPP and Mono2x

IL2CPP is a Unity-developed scripting back-end which you can use as an alternative to Mono when building projects for some platforms. Note - IL2CPP is only available when building for the following ...
19
votes
1answer
3k 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
6k 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: ...
18
votes
1answer
3k views

How can I fade player character when he goes inside or outside of the area?

I want to fade the player when he goes out of the area. For example, suppose a person enters a building. When a person is outside of the building, he shouldn't be seen, but when he enters he ...
18
votes
4answers
23k views

Is C# different in Unity?

Does Unity use a different version of C#, or is it all the same? It looks different from regular C# but there are some regular C# elements in there.
18
votes
2answers
5k views

RTS game unit structure

I want a way to make a lot of different units without having to program stuff like moveTo and Attack actions more than once The way I see it, there are 2 ways I can do this. A single generic Unit ...
18
votes
1answer
6k views

What is the size limit to the Unity 2017.2 Tilemap?

I've been digging through the documentation on the Tilemap feature of Unity 2017.2. Does Unity limit the maximum number of tiles it will support for a particular tilemap mesh? I know that each tile ...
18
votes
2answers
7k views

How to blend two cameras when traveling through a portal in Unity3D

Before I get to my question, I know the most obvious solution would be to use the normalized view port rect, however I need more complex shapes than a rectangle, and I've looked in to using the view ...
18
votes
1answer
2k views

How to support Surface pens in Unity?

Our game works great with touch or mouse, but the Surface pen doesn't seem to register as a pointing device at all. How can we support the pen in Unity in a native build? This question on the Unity ...
17
votes
3answers
5k views

How to avoid movement speed stacking when multiple keys are pressed?

I've started a new game which requires no mouse, thus leaving the movement up to the keyboard. I have tried to incorporate 8 directions; up, left, right, up-right and so on. However when I press more ...
17
votes
1answer
6k views

Player jittering against wall when held down button

So, I'm making a top down RPG. Everything's going excellent, but this problem is quite annoying. Now, when the character moves against the wall, the player jitters back and forth. I'm guessing it's ...
17
votes
1answer
3k views

Any downsides to exporting an audio file at double-speed then have the game engine playback at half-speed?

I want to cut back on my game's file size and music and SFX are taking up a good chunk. If I make a song or sound effect at 120bpm and then apply a tempo and pitch doubling using a DAW or standalone ...
17
votes
4answers
66k views

Unity new UI - Dynamically change the functions called by GUI elements

Looking to dynamically change the value in the button OnClick and slider On Value Changed . If I had to guess on how this was done, get a reference to the button/gui element. Next get the Button ...
17
votes
3answers
3k views

Is Unity 2017 random number generator deterministic across platforms given the same initial seed?

Is unity engines random number generator deterministic across platforms given the same initial seed or should I implement my own? I know there have been some modifications to the random number ...
17
votes
1answer
12k views

Does `yield return false;` have special meaning in Unity3d C# scripts?

In Unity, we have some special things for coroutines that are additional to normal C#. for example, we can use yield return WaitForSeconds(5.f); to have a ...
17
votes
1answer
8k views

Procedural Mesh: UV mapping

I made a procedural mesh and now I want to apply a texture to it. The problem is, I cannot get it to stick the way I want it to. The idea is to have the texture painted only once over the whole mesh,...
17
votes
3answers
13k views

Ledge grab and climb in Unity3D

I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it. Now my question, since I've been ...
16
votes
4answers
74k views

How to read a data from text file in unity

Can anybody help me out with giving the steps needed for reading data from the text file in unity and how can the script be added.
16
votes
3answers
4k views

Will Unity skills be transferable?

I'm currently learning Unity and working my way through a video game maths primer text book. My goal is to create a racing game for WebGL (using Three.js and maybe Physic.js). I'm well aware that ...
16
votes
3answers
8k views

How can I implement a “fast-forward” feature in my game?

How can I implement the fast forward feature for my tower defense game like in http://fieldrunners.com/ and other TD games? I am using Unity 3D. Would there be something to manage fewer frames per ...
16
votes
6answers
17k views

Unity3D, how much code do you write? [closed]

I'm curious to know the workflow when creating a game in Unity3D? Does it generate a lot of code for you? My understanding is that you describe the game in Unity and do scripting on the back end to ...
16
votes
1answer
41k views

Is it legal to sell or monetize games created with the Unity 3D free edition?

Is it okay to use Unity 3D programming and gaming software to create mobile game apps for Android and iOS? I am using a free version of Unity 3D and planning it to sell my current game app I've ...
16
votes
6answers
2k views

How to make my characters turn smoothy while walking on a path(list of coordinates)?

I have a list with coordinates - output from A* algorithm - and I would like to make my characters smoothly follow this path with rotations. So I have something like A and I want to get C How can I ...
16
votes
2answers
18k views

Where to attach global scripts in Unity?

As far as Iknow in Unity, every script must be attached to an object. But what is the case with global scripts? For example in a tetris-like game to which object should I attach the element spawner ...
16
votes
1answer
18k views

Can Unity 2D be used to make pixel-art games?

I'm looking at the new 2D features introduced in Unity 4.3, and I think I might be missing something. To me it looks like they are designed for high-res 2D games, where scaling the sprites is ok, but ...
16
votes
4answers
20k views

How could I constrain player movement to the surface of a 3D object using Unity?

I'm trying to create an effect similar to that of Mario Galaxy or Geometry Wars 3 where as the player walks around the "planet" gravity seems to adjust and they don't fall off the edge of the object ...
16
votes
1answer
9k views

Pathfinding on a uneven planetary surface

My question is what would be the best approach to pathfinding on an uneven planetary surface? Background Information I have created a planet from displacement mapping 6 sphere projected planes. The ...
16
votes
3answers
8k views

How do I blend 2 lightmaps for day/night cycle in Unity?

Before I say anything else: I'm using dual lightmaps, meaning I need to blend both a near and a far. So I've been working on this for a while now, I have a whole day/night cycle set up for renderers ...
15
votes
3answers
46k views

Typical Maximum steering angle of a real car

I'm building a car sim in Unity3D. I'm trying to set the properties of the car to be as realistic as possible. I can't seem to get a straight answer on Google so I thought of asking here. What is the ...
15
votes
3answers
17k views

Create a trailing, ghosting effect of a sprite

I want to create a trailing, ghosting like effect of a sprite that's moving fast. Something very similar to this image of Sonic (apologies of bad quality, it's the only example I could find of the ...
15
votes
1answer
21k views

How do I use Android's adaptive icons in Unity?

As of API 26, Android uses something called adaptive icons. When targeting API 25 and lower, my app's icon looks fine: But when targeting API 26+, it shows up in a white circle like so: How can I ...
15
votes
2answers
9k views

Does Unity own my game?

I made my first game in unity, and I was wondering if I can sell it without owing anything to unity?
15
votes
2answers
7k views

How should I account for the GC when building games with Unity?

*As far as I know, Unity3D for iOS is based on the Mono runtime and Mono has only generational mark & sweep GC. This GC system can't avoid GC time which stops game system. Instance pooling can ...
15
votes
6answers
18k views

How to properly differentiate single-clicks and double-click in Unity3D using C#?

What I am trying to understand and learn here is a very basic thing: what is the most general and most polished way to properly differentiate single-clicks and double-clicks for the 3 main mouse ...
15
votes
1answer
3k views

How to file down a fingernail mesh?

I am creating a nail salon 3D game where I need to implement nail filing mechanics. I have tried out approaches including mesh deformation but I'm concerned about performance as I am targeting mobile ...
15
votes
2answers
996 views

Make platform's visibility distinct from background

I have a 2d infinite runner type game which background is changing its colors constantly. Meanwhile the color of the platforms stays the same. This way the platforms at some point(when their color is ...
15
votes
2answers
28k views

Smooth loading screen between scenes

I created a loading screen to display a loading animation as the next scene is loading. I load the next scene asynchronously with: ...
15
votes
5answers
16k views

Unity 3D engine for Ubuntu?

Is there any way to get Unity 3D to run on Ubuntu. I am currently running Ubuntu 12.04 64bit edition. I also have Wine installed.
15
votes
4answers
3k views

Why does my game display the wrong “required Android version” on Google Play?

I'm porting a Unity game to Android, and I've set up the "Minimum API Level" in the Player settings to "2.3.3 (API level 10)". However, on the store, it says "Requires Android: 1.6 and up". On the ...
15
votes
5answers
31k views

How can I draw an outline in Unity3d?

I am trying to highlight a rectangle of arbitrary height. I thought the easiest way to do this would be to create a separate "box" gameobject that outlines the rectangle. I've tried with both a ...
15
votes
3answers
32k views

Can I do server side programming with unity? [closed]

Another thought to my last question. If i were to do a client/server game with unity3d would i be able to do serverside programming with unity? if not can i use C# .net? if not then is there some sort ...
14
votes
3answers
24k views

How to get all tiles from a Tilemap?

I have been trying a little bit the new TileMap system in Unity and I was looking for a way to access the tiles as a List or 2D array but I can't find anything ...
14
votes
4answers
18k views

The underlying mechanism in 'yield return www' of Unity3D Game Engine

In the Unity3D game engine, a common code sequence for getting remote data is this: ...
14
votes
3answers
7k views

Are .sln / .csproj usefull for sharing the Unity project?

We are experiencing some problems with GIT and Unity. It occurs pretty often that file .sln / .csproj give us some trouble, so after searching for a while on the web I've found that maybe this files ...
14
votes
4answers
11k views

Difference between Update method and FixedUpdate in Unity?

i am starting to learn Unity3d and one of the confusion i get is difference between Update() and FixedUpdate(). I am following ...