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
11
votes
2answers
24k views

Does Unity for PC use Direct3D or OpenGL? [closed]

I am a mac developer using Unity and I hardly use a PC. When you build a Unity game for Windows, does it use Direct3D or OpenGL? P.S. I'm not sure if it's called Direct3D or DirectX
11
votes
3answers
815 views

How to simulate pressure with particles?

I'm trying to simulate pressure with a collection of spherical particles in a Unity game I'm building. A couple notes about the problem: The goal is to fill a constantly changing 2d space/void with ...
11
votes
2answers
7k views

How to use the BillboardRenderer in Unity?

Since version 5 (?) Unity has a new component-type BillboardRenderer. Unfortunately the documentation is quite poor. It can be added in the inspector by clicking ...
11
votes
1answer
2k views

Creating a Robust Item System

My aim is to create a modular / as generic as possible item system which could handle things like: Upgradeable Items (+6 Katana) Stat Modifiers(+15 dexterity) Item Modifiers(%X chance to do Y damage, ...
11
votes
2answers
8k views

Video playback in Unity

I'm not satisfied with the quality of video playback in Unity (Movie texture which I run after converting video with Miro converter and importing it to Unity),... so, is there any chance that there is ...
11
votes
2answers
7k views

How to await async operations / coroutines?

I'm looking for a generic / reusable way to wait for coroutines and asynchronous operations to finish in Unity 5, similiar to C#5's await keyword. The simplest way ...
11
votes
1answer
5k views

Rendering Unity across multiple monitors

At the moment I am trying to get unity to run across 2 monitors. I've done some research and know that this is, strictly, possible. There is a workaround where you basically have to fluff your window ...
11
votes
2answers
1k views

How can I visually see changes made to a scene since the last git commit

I'd like to see the changes made in a scene (.unity file) before I commit them to git. I have looked into several GIT/Unity solutions but all of them are made for merging changes and not for showing ...
10
votes
7answers
7k views

How best to structure/manage hundreds of 'in-game' characters

I've been making a simple RTS game, which contains hundreds of characters like Crusader Kings 2, in Unity. For storing them the easiest option would be to use scriptable objects, but that isn't a good ...
10
votes
3answers
2k views

Execute a function for ten seconds and disable it for two seconds

I have a particular function which I am calling in Update function. For the first ten seconds, the function should get called in Update function, then it should get disabled for next two seconds, then ...
10
votes
1answer
9k views

How can I create a height-based volumetric fog?

Recently, I have been looking for techniques to make volumetric fog on some Y position level of the game world. But all I have found are some fog made by using particle system or built-in engine fog ...
10
votes
4answers
9k views

How to synchronize a game with music

You may be familiar with ryhtm games as Dancing Line, Geometry Dash, or even Guitar Hero. They have something in common : every single action in the game is synchronized with the music. My purpose is ...
10
votes
2answers
2k views

Season Change Reveal Effect

I was watching the teaser trailer for Seasons After Fall, and I was struck by the effect they use to transition between seasons (around 21-24 seconds): The level art, including the background and the ...
10
votes
3answers
15k views

Unity Android versus android SDK

I am familiar with Unity and in the process of learning android SDK when the announcement about unity android basic came out. What would be the advantages and disadvantages of using the android SDK ...
10
votes
1answer
3k views

Confusion about Sprite Size in World Space (Unity)

I have a Sprite with 1080x1920 resolution. And I set the Game View Resolution also to 1080x1920. What I was thinking is that the sprite (1080x1920) should fit correctly within the Camera View. But ...
10
votes
2answers
4k views

Is white the best base color to start with when planning to shade sprites within Unity?

I'm looking into prototyping a game in Unity which will consist of solid square sprites / tiles. I figure I can represent different types of objects with different colors for each of the tiles in the ...
10
votes
2answers
20k views

What's the difference between Update and FixedUpdate in Unity, and should I bother?

I was told to use Update() for graphics and FixedUpdate() for physics, but sometimes my inputs won't register when I use ...
10
votes
1answer
1k views

Finding the correct speed for AI to turn to reach goal

I have a ship that travels at max speed maxSpeed and can turn rotationSpeed degrees per second. The ship always moves in the ...
10
votes
2answers
20k views

Shader that “cuts” hole through all geometry

How can I create a shader that "cuts" through all geometry, only rendering the clearing background in Unity? An example: That's a prism in a huge white box-shaped room. The surface of the prism is ...
10
votes
3answers
2k views

How to handle RTS Click-And-Move in 3D Space?

How can I handle the click-and-move in a complete 3D space? It is easy to handle on a 2D plane by a simple raycast, but this is not the case in 3D since there is no end-plane for a raycast to get an ...
10
votes
2answers
4k views

problem with git on a unity project

I tried to version control my project folder with git. When it came to pull the project from the repository, though, something went wrong: apparently scripts are missing and the prefabs and kind of ...
10
votes
1answer
956 views

How can I fix zig-zagging UV mapping artifacts on a generated mesh that tapers?

I am creating a procedural mesh based on a curve and the size of the mesh gets smaller throughout the curve as you see below. And the problem is UV gets zig-zagged as the size changes (it works ...
10
votes
1answer
543 views

Getting a 2D “pixel” cloud to follow a mouse

I'm working on a 2D game trying to get a "cloud" of a few hundred tiny cubes or discs to follow my mouse cursor without overlapping each other. However, using the physics engine introduces ...
10
votes
1answer
12k views

Why does Unity let you install iOS Build Support on Windows?

When installing Unity on a Windows machine, you are allowed to select "iOS Build Support" as one of the components to install. However, it is not possible to make an iOS build from Windows. Why is ...
10
votes
2answers
1k views

Conditional Variables in Scriptable Objects

While using ScriptableObjects, how can I make some variables conditional? Example Code: ...
10
votes
4answers
14k views

How to make Line Renderer lines stay flat?

I've noticed that as I add more vertexes to a Line Renderer line the line twists and stops being a smooth line. .GIF Here: http://i.imgur.com/hRAhCXM.gif All lines are on the same z level, even if ...
10
votes
3answers
4k views

Can I run my own loading script during the Unity splash screen?

Can I load data in the background while the Unity splash screen is up? If so, how? I am trying to run code during the splash screen, not just load assets. I have not been able to find any ...
10
votes
1answer
2k views

Determining how loud an AudioClip is

I have some code that uses GetSpectrumData from an AudioSource playing a song to create a level layout for the player to play. I want to add a functionality where ...
10
votes
2answers
6k views

Accessing DualShock 4 motion sensor in Windows (ideally Unity)

I'm trying to use a DualShock 4's IMU as a motion controller in Unity, under Windows 7. So far I've tried: DS4Windows (1.5.11): reads motion sensor data, but does not expose them to Unity as axes ...
10
votes
2answers
2k views

Prototype experience: Unity3D vs UDK [closed]

Has anyone yet prototyped a game in both Unity3D and UDK? If so, which features made prototyping the game easier or more difficult in each toolkit? Was one prototype demonstrably better than the ...
10
votes
2answers
6k views

How do I flatten terrain under a game object?

I've got a script that makes a terrain object and paints it with textures, but I'm having an issue. When I attempt to place game objects (such as the simple water object that unity provides), I use a ...
10
votes
4answers
1k views

Calculating missile trajectory around orbits before shooting

I'm building a game with Unity3D. It's a Gravity Wars clone. Both player and AI turrets shoot missiles at each other (giving an Angle and a Power variables), trying not to crash missiles on planets. ...
10
votes
5answers
29k views

How to create a new GameObject, without adding it to the scene?

I'm creating what is essentially my own prefab system. Game objects are defined by a human readable data file. I'd like to create an empty GameObject, load it with the components defined in the data ...
10
votes
2answers
4k views

Unity Occlusion Portals: What and How?

(Here I eat my words on Meta about posting Unity questions on Unity Answers... since that site is less responsive than this one.) Unity provides cell-based Occlusion Culling (via Umbra, I believe). ...
10
votes
1answer
8k views

Can you embed a Unity3d mobile project into an existing native mobile app?

I am creating an application for both Android and iPhone that will have a few mini games in it. I would like to create the non game section in native Android and iPhone. My question is, is it possible ...
10
votes
2answers
1k views

How to project a foam trail on dynamically changing mesh

I am trying to create water, and right now I got it through dynamically generating waves on a mesh. But now I want to make my boat manipulate these waves, and cause a Kelvin Wake on top of this. ...
10
votes
1answer
6k views

Inline sprites in Unity's text?

How can I use different materials when using the tag for Unity's rich text syntax? I want to be able to have sprites that are inline with my text without having to create custom fonts. Here's what I ...
10
votes
3answers
3k views

Preventing a Combination of Rigidbody Jump Force & Bounce Magnitude in Unity3D

I'm building a fairly simple marble racing game in Unity3D. The ball is a 3D physics object that moves only on the X and Y axes. It has the ability to roll left and right, and to jump. Pretty basic ...
10
votes
1answer
1k views

How to save the Mesh from an Interactive Cloth at runtime in Unity?

At the start of a scene I have GameObject called 'sheet' positioned above a 'ball' GameObject. The sheet has an Interactive Cloth component on it and a Cloth Renderer. The Mesh for the Interactive ...
9
votes
2answers
3k views

Generate random number in Unity without class ambiguity

I have a problem in Unity (C#) where I would like to create a random number. I wanted to use System.Random (reference: using ...
9
votes
5answers
5k views

Why can't I use the operator '>=' with Vector3s?

I am trying to get a rectangle to move between two positions which I refer to as _positionA and _positionB. Both are of type <...
9
votes
4answers
16k views

Why doesn't my C#6 code compile in Unity?

Why can't Unity work with C# 6 code? It always gives me compiler errors. Here are some code examples: ...
9
votes
7answers
25k views

Why do my point lights disappear when another nearby light is above 1.85 range?

I'm making a game with a dungeon setting in Unity 3D. Many torches line the walls. I'm using a point light over each torch to simulate the flame. However, when two torches are across from each other, ...
9
votes
4answers
2k views

Should Unity lifecycle methods be annotated with the UsedImplicitly attribute?

Does annotating Unity lifecycle methods with the UsedImplicitly attribute improve the readability of your code? For example: ...
9
votes
2answers
6k views

Why do Unity layer masks need to use bit shifting?

I've finally figured out why my layer masks for my ground collision code weren't working. I was using NameToLayer() to get the layer I needed, but layer masks use ...
9
votes
2answers
2k views

How to make a field visible (attachable) in the inspector but inaccessible through code (private-like)?

Let's say I have a variable named button of type Button which is of course ...
9
votes
1answer
3k views

Unity - Order in Z layer for objects

Sorry if the title isn't exactly what my question is, I don't really know how to describe it. I have an image for my city floor and an image (same size) for all the walls or trees that the player is ...
9
votes
2answers
3k views

Coroutines in series

How would i go about stacking up a series of Coroutine calls that should be executed one after the other? I have tried getting a flashing color effect looping a series of color lerps in a coroutine ...
9
votes
3answers
14k views

Unity: “inconsistent line endings” dialog shows up ever time I open VS with unity

Everytime I open a script file from unity with visual studio this dialog shows up about normalizing the line endings? What does this mean? I click Yes every time but still can't get rid of it. It only ...
9
votes
1answer
16k views

ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-games:8.1+

Getting this error: ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-games:8.1+ Google.JarResolver.PlayServicesSupport.DependOn (System.String group, ...