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
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
4answers
20k 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
4k 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
2answers
6k views

How to design context menus based on whatever the object is?

I'm looking for a solution for a "Right Click Options" behaviour. Basically any and every item in a game, when right clicked, can display a set of options based on whatever the object is. Right ...
18
votes
2answers
21k 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 ...
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 ...
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
5k 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
17k views

When should I use velocity versus addForce when dealing with player objects?

I'm confused about these two methods in the Unity framework. Both make the player object move, stop, change direction, etc. When should one be used over the other and when is one appropriate?
17
votes
4answers
65k 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
1answer
4k 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 ...
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
7k 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,...
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
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 ...
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
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
3answers
2k 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 ...
16
votes
4answers
16k 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
8k 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
12k 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
3answers
7k 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
7k 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 ...
15
votes
3answers
15k 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
2answers
8k 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
7answers
13k 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
2answers
973 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
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 ...
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
3answers
31k 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 ...
15
votes
1answer
1k 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 ...
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
1answer
3k views

How to implement a shotgun in a game?

Pistols and machine guns are easy - you can just have bullets flying in a certain direction, so I already implemented that. A shotgun, on the other hand, does damage to anything in a certain area that ...
14
votes
3answers
3k views

Looking for some insight on programming design for attacking and attack types in a game

So, I'm starting to introduce attacking to our 2D space RTS (This is in Unity, so it's component driven). Initially it was as simple as "enemy in range, damage applied". However there will be multiple ...
14
votes
3answers
3k views

Unity - How to move a ship realistically to a point in a 2D top-down game

i'm trying to move a sailing ship to the point where i clicked with the mouse. this movement should be realistic (oar at the back where the ship moves around) so if the mouse click is left and in ...
14
votes
3answers
3k views

The reasons behind Unity3D engine design (game object/transform component)

I'm trying to understand the reasoning behind Unity3D engine design and this is something I can't get my head around yet: why is transform data stored in a separate component, instead of being a part ...
14
votes
5answers
30k views

Ignore collisions with some objects in certain contexts

I'm making a racing game with cars in Unity. The car has a boost/nitro powerup. While boosting, I wouldn't want to be deviated when colliding with zombies, but I do want to be deviated when colliding ...
14
votes
2answers
4k views

Why are trees shining in background?

Currently I am creating a forest scene in the dark, and the trees are shining far away, but when I get close they are fine. I have the shaders set to "Nature/Tree Soft Occlusion [bark/leaves]", but ...
14
votes
0answers
7k views

Creating Rope Physics for Unity [closed]

I want to create a bungee jumping-like game in Unity and therefore I need a rope physics. I especially need elastic ropes with capability to pull objects with velocity after a little extension. Do you ...
13
votes
4answers
57k 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.
13
votes
2answers
5k views

Movement appears to be frame rate dependent, despite use of Time.deltaTime

I have the following code to calculate the translation required to move a game object in Unity, which is called in LateUpdate. From what I understand, my use of <...
13
votes
3answers
8k views

Unity coroutine vs threads

Whats the difference between a coroutine and a thread? Are there any advantages of using one over the other?
13
votes
3answers
12k views

How do C# and UnityScript differ in Unity development? [closed]

Other than the obvious language differences, how do UnityScript and C# differ when developing games in Unity3D? Is there a noticable performance difference? Is the UnityScript code packaged as-is? If ...
13
votes
3answers
40k 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 ...
13
votes
2answers
911 views

File operation(s) failure on game crash/kill by OS/User in Android

My game saves its state after fixed interval on a file in game/app internal storage. When my game is killed or crashed by user or OS respectively, We write current game state on that file. File ...
13
votes
3answers
6k 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 ...
13
votes
4answers
10k 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 ...