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
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
5answers
6k 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
17k 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
27k 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
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
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
1answer
11k views

Animated textures for models; How to write a shader?

Was watching some Rocket League and notice there was animated decals and wheels. . I would like to implement something similar to the effects in the image above. How would I go about writing a ...
9
votes
3answers
5k views

How do I make Unity halt on exceptions?

I'm trying to debug a Unity project using the Unity Editor and Visual Studio. A runtime exception keeps popping up, but the debugger doesn't halt when an exception occurs, making it impossible to ...
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, ...
9
votes
2answers
15k views

What's the difference between Mathf.Lerp and Mathf.SmoothDamp

I want to smoothly go from one value to a new one (moving a slider or changing color). I tried using both functions and they all basically give the same result. What is the difference between them and ...
9
votes
5answers
8k views

Non-destructive way to edit alpha channel in Photoshop/Gimp image

Looking to make textures for Unity3d, and I'm stuck at what seems to be a simple stage. My goal is to create an RGBA image, with color information for every pixel, and a separate alpha channel. These ...
9
votes
2answers
597 views

How to avoid spaghetti in the animator?

I am working with animations in Unity and so far I have made only four (Up Down Left and Right) and my animation window looks following... Problem is that if I was moving Up I want hero to stay ...
9
votes
2answers
35k views

How to detect mouse over for UI image in Unity 5?

I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
9
votes
2answers
590 views

Why doesn't light continuous on my model?

I created a basic textured cube model with Blender to practice modeling, and then I imported it into Unity. After I put up some lighting it looks pretty ugly. The light is not continuous on a row of ...
9
votes
1answer
16k views

Angle between two points

I have a character who walks to random points in my room in Unity. The problem is he always faces one direction, I want to write in C# a piece of code that will get the direction the character is ...
9
votes
2answers
12k views

When should I mark GameObjects as Static?

Here is the corresponding Unity documentation. According to explanations of Unity documantation pages about Static GameObjects, sometimes marking GameObjects as static may effect performance in a bad ...
9
votes
3answers
580 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: ...
9
votes
2answers
30k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
9
votes
1answer
4k views

How can I record from a second in-game camera and later export it to a video file?

I'm making a PC Horror game in Unity, and I want to have a camera recording simulation in-game - so you can leave a creepy location anytime, and you will have a tape with what you recorded on camera ...
9
votes
2answers
5k views

How well does Unity 3d work for both Android and iPhone?

First off this question might be a bit broad so I apologize if it is. I am really just looking for peoples experiences and personal knowledge on the subject. I am looking to create a game for both ...
9
votes
1answer
8k views

How to create high quality and fast portal effect?

EDIT: So I've gotten the portal visual effect working with no performance hit, and I've got the physics set up of objects with rigidbodies moving through portals seamlessly, and objects with character ...
9
votes
3answers
297 views

How to have multiple GameObjects sharing pieces of same material?

My question is: There's any way of having GameObjects sharing pieces of same Material, not a clone, but an extension of one? For example, in these case nine game objects sharing just the same material ...
9
votes
1answer
1k views

Building an Octree for terrain generation

I've previously implemented marching cubes/tetrahedra to render an IsoSurface. It worked (YouTube), but the performance was dire as I never got around to implementing variable Level of Detail based on ...
9
votes
1answer
955 views

How do I manually draw a part of a sprite sheet?

I'm working in Unity, and I'm finding that the animator isn't working for what I'm trying to do, in my 2D game. I want to build a specific animation, using sprite sheets, and be able to reuse the ...
9
votes
1answer
2k views

2D Water top surface profile

I am trying to create the effect of the water surface thickness with a vertex-fragment shader. I am in a 3D game environment but It's a scroll view so a "2D" view. Here is a good tutorial of creating ...
9
votes
1answer
3k views

How to occlude lights in Unity3D?

First off, I own Unity Pro. I've been looking in to occluding lights when they aren't being viewed for a while now to improve performance. The main methods I ran in to were using BecameVisible() and ...
9
votes
2answers
16k views

How do I make my character slide down high-angled slopes?

I am currently working on my character's movement in Unity3D. I managed to make him move relatively to the mouse cursor. I set a slope limit of 45°, which does not allow the character to walk up the ...
9
votes
0answers
130 views

Why Can't I duck reverb on the mix bus in Unity?

i'm surprised there is so little documentation on this issue. But i'm trying to duck the audio on all the mix buses in Unity so that you can clearly hear the VO of the game. Now it works great except ...
8
votes
4answers
5k views

Mechanics to keep mobs and environment alive without using tons of memory?

I'm working on a server for a little mobile MMORPG. This consists mainly of two important features: mobs and environment resources like trees, rocks etc. The world is randomly generated and each time ...
8
votes
2answers
1k views

Unity 3d 4 players Only 4 buttons can be pressed at a time

Only 4 buttons can be pressed at a time, so players cant move sometimes Each Player Has their own Controls i Change, Up Arrow and the other ones for each player---v InputsV-V-V ...
8
votes
6answers
4k views

Why am I not getting stuck in the loop

I'm new to Unity. I was learning coroutines and I wrote this. ...
8
votes
1answer
51k views

Graphics Raycaster of Unity; How does it work?

I'm making a small game for the first time and enjoying it thus far. The only thing that keeps bothering me is that I can't find a human explanation of what the graphics raycaster does. What's the ...
8
votes
2answers
3k views

Constant 2D Bullet movement in a shmup

I've been following the pixelnest tutorial to make a 2D shmup (http://pixelnest.io/tutorials/2d-game-unity/player-and-enemies/). While working on this I've experimented with increasing the firing ...
8
votes
1answer
35k views

Unity 5 2D drawing sprites programmatically

How can I draw sprites in Unity 5 programmatically ? I am looking for something similar to spriteBatch.Draw() in XNA. The results I get when I search about it are ...
8
votes
1answer
2k views

Is it wrong to be creating new objects in Update()?

I'm using Unity and sometimes I'm using th new keyword in Update, like new Vector3() etc... ...
8
votes
3answers
22k views

How to dynamically create an UI text Object in Unity 5?

I have been searching for something that should be simple, but Unity 5's documentation on that is fairly outdated. What I want to achieve is to be able to create UI Text totally from script, i.e. ...
8
votes
3answers
1k views

How can I keep two racing players synchronised?

I am working on a Unity mobile game, much like a multiplayer version of Temple Run. I'm seeing a fluctuating network latency (generally 200-500ms) because of the mobile platform. The two player ...
8
votes
2answers
7k views

Where and how to check if game was developed with bought Unity3D licence (not cracked app)?

We hired an external team from Eastern country. They built our mobile game app using Unity3d which we paid a lot of $K. We asked them to only use the software with bought license, not cracked one, and ...
8
votes
2answers
7k views

Why does Unity3D crash in VirtualBox?

I'm running Unity3D in a virtual instance of Windows, using the Virtual Box software on Linux. I have guest additions installed with DirectX support. I've tried using Windows XP SP3 32-bit, and ...
8
votes
4answers
2k views

Which for basic RTS prototype: Unity or Torque? [closed]

I'm wanting to test my hand at writing an RTS (something I've never gotten very far with), and so I'm looking for an indie engine that would give me the most success with a quick setup that I can then ...
8
votes
3answers
992 views

Can a Game Engine be built into a Game Engine?

This confuses me as the title says "Mostly Civilized: A Hex-Based 4x Game Engine for Unity - Part 1" Unity is a Game Engine, and he is building a game engine for a game engine. Did he word this ...
8
votes
2answers
878 views

How to create a 2D physics waterfall

I am trying to create a waterfall that looks similar to the first image below (please check this video for a better idea of what I want to achieve) with physics properties so it can move or around ...
8
votes
3answers
5k views

Overcoming float limitations for planet-sized worlds in Unity

As far as I know, going further than 1M units from the world origin in Unity is hardly possible due to floating point precision issues. Making a world more than 1M units in radius would require ...
8
votes
1answer
2k views

Moving texture according to position in shader

Divinity Original Sin have beautiful particle effect , When I move around game I see galaxy through particle that move according to my position.how can I make like it? you can see this effect here: ...
8
votes
2answers
5k views

Why is the for loop more efficient than the for each loop in Unity?

During a Unity talk about performance, the guy told us to avoid for each loop to increase performance and use the normal for loop instead. What's the difference ...
8
votes
2answers
16k views

Button stays highlighted after being clicked - Unity3D 4.6 GUI

Sometimes, after clicking a button created by unity's new UI Button, the button stays in its highlight state. Note that Button script has Color Tint set as it's <...
8
votes
4answers
3k views

Infinite 3D Cave in Unity

A friend and I are hoping to make a game in Unity in which you fly through an infinite 3D cave that can twist and wind in any direction (though obviously not to the point that the turns are impossible ...
8
votes
1answer
8k views

How do I compile a C# script at runtime and attach it as a component to a game object

The idea here is to let users program the behaviour of an agent in a way that reminds of the "Screeps" game, where you get to develop code which later runs and dictates the behaviour of your units. ...
8
votes
2answers
9k views

Pointers in C# Unity

Hey I've just learned about pointers recently and am wondering how I can use them in c# (I just learned about them in c++) in unity. I do have some questions though. Pointers use low level ...

1
3 4
5
6 7
246