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.

learn more… | top users | synonyms (1)

0
votes
2answers
46 views

Checking if object passed between two other objects

I have a three objects (strikers), lets say red, green and blue. When I apply force to the green object I want to check if it has passed between red and blue or not. See the image below for an ...
1
vote
2answers
47 views

How can I create a precise touch in Unity

Is there a way so that I can touch an object precisely? I have these aerial cars and there pretty tiny like 32 by 32 and it's hard to touch them using a raycast. I thought I'd spawn an object with a ...
0
votes
1answer
84 views

Unity 4.6 UI button AddListener sets the same callback to all items in List

I have this method that is looping through a list and sets values on the current item in the list. Everything works fine the lists values are correct exept the AddListener. All listeners on the ...
0
votes
1answer
53 views

Position GameObject sprite where I tap on the screen

I can't do one of the simplest things. When the player taps the screen, I want to put my sprite in that place. public class Controller : MonoBehaviour { public GameObject ball; // A GameObject ...
0
votes
1answer
49 views

Unity3D - How do I make so when user moves the camera it doesn't go beyond the scene borders?

How do i make so when i move my camera, it doesn't go beyond the border of the canvas while playing. This is the script i use to make the camera move: if (Input.touchCount > 0 && ...
14
votes
6answers
1k views

How can I avoid tight script coupling in Unity?

Some time ago I started working with Unity and I still struggle with the issue of tightly coupled scripts. How can I structure my code to avoid this problem? For example: I want to have health and ...
1
vote
1answer
95 views

Is there any way of creating primitive 2D shapes in unity?

I have read the whole unity manual and watched the videos on sprites but I have a question. Is there any way of creating primitive 2D shapes in unity? (I will be assigning trigger colliders to these ...
0
votes
1answer
69 views

Find closest point on NavMesh if current target unreachable

I have a mock environment set up with a cube that has a specified "Not Walkable" layer. I'm using NavMeshAgent and NavMeshPath to set destinations of the player. The way I'm setting paths is by ...
0
votes
1answer
22 views

Fb.Feed dialog closes before saving

I'm having trouble with the Facebook UnitySDK when I use the FB.Feed() method for posting on user's timeline. The share dialog closes before the post is completed, Right after i press the "Post" ...
1
vote
2answers
68 views

Camera.WorldToScreenPoint not working with perspective

transform.position = Camera.main.WorldToScreenPoint( new Vector3( origin.position.x, origin.position.y, origin.position.z ) ); I have this code on a Unity 4.6 UI object. The origin is some transform ...
1
vote
1answer
39 views

NavMeshAgent.CalculatePath - how to use properly?

I seriously can't figure out how to use this function, and the documentation doesn't help at all. Here's the documentation code: public class ExampleClass : MonoBehaviour { public Transform target; ...
1
vote
1answer
67 views

OnMouseUpAsButton not always called

I'm working on a 2D implementation of Free Cell in Unity 4.6.1, and I'm having trouble getting my click-detection code working consistently. The code below should be called every time a card is ...
-1
votes
1answer
88 views

Can one sell the game made in unity free version? [duplicate]

I'm just getting into it and soon my first project will be done. Can I sell it afterwards?
5
votes
4answers
420 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 Lynda Unity 2D game development tutorial there, the instructor uses ...
1
vote
1answer
85 views

Player Gravity Questions

I've made it so that all entities have complex box colliders for hit detection purposes. These entities also have character controllers on them. The problem? Gravity, or lack thereof. When the ...
6
votes
1answer
168 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 ...
2
votes
2answers
111 views

Storing Type/Game Data Within A Unity 3D Game Using An Offline Flatfile Database

I've read several documents on how to manage game type data: Would it be better to use XML/JSON/Text or a database to store game content? How to choose how to store data? Im developing an offline ...
3
votes
0answers
105 views

Unity3D [C#]: How do I use a custom inspector to expose an array of polymorphic objects to edit?

[EDIT: based on some feedback, I pruned the example down to the base functionality of the bug we are trying to solve. The description below remains accurate, but the repro has been shortened to: ...
1
vote
1answer
71 views

Responding to mouse input on game objects

I'm trying to make a simple button in unity using a cube. My plan is for when the cube is highlighted that it will move towards the camera and be highlighted in a specific color and then when it is ...
1
vote
2answers
39 views

How to prevent intepolated texture in fragment shader (Unity CG)

Think about minecraft - all the textures in minecraft have a very nice crisp pixelated look. Well, I'm trying to write a shader that will do this but it appears "sampler2d" returns some sort of ...
1
vote
2answers
87 views

How can I run a Unity game in a window larger than the desktop resolution?

I am exploring a research problem using Unity. I require a game resolution of at least 4096 x 786. There seems to be no option under build settings for setting a fixed screen size window. (The default ...
0
votes
0answers
70 views

Unity 4.6 New GUI Issue with GIT

I am using Unity 4.6 new UI. I have my project setup on bit bucket (using GIT). It was working fine but when I cloned the project on another macbook. All the unity new UI scripts went missing. Is ...
0
votes
1answer
40 views

Unity provides wrong Input value if game is started with bumpers pressed down

As the title states I am having an issue with the following. It is a pretty specific edge case but it is something I can't work around. In Unity I have created two Axes to allow me to check the value ...
0
votes
1answer
51 views

Unity C# Microphone input in Android different than on PC?

I'm working on a mobile app inside Unity, in which I need to input and repeat microphone input almost immediately.. I've worked it out and it works great when I play it from within the Unity Editor. ...
1
vote
1answer
49 views

Adding materials to a Line Renderer through code? (Unity)

I have a material that I am using to add a glowing effect to my line renderer. I can add this as a 2nd material to the line to give it a glowing effect. I want to be able to add/remove this material ...
0
votes
1answer
67 views

Unity: Smooth collision

I'm making a topdown 2D RPG in Unity. All moveable objects have Rigidbody2D-components with gravity set to 0, linear drag set to 5 and different masses. Walls are stationary boxes with BoxCollider2Ds. ...
2
votes
1answer
83 views

What is the performance impact of rendering a larger quad?

Lets say I have two planes and I textured them in blender with a 512*512 tiled texture. One plane is bigger than the other (for example, one plane tiles the texture 60 times but another only six ...
0
votes
3answers
52 views

How do I size my map in blender so it will be the right size in unity?

I am working on a fps game but I cant get the size right of my map in blender, every time I export it to a .fbx file (unity won't work if it is a .blend file) it is a super small plane floor in unity ...
0
votes
2answers
47 views

How to flick gameObject using Touch?

I've been searching for a solution for my problem for a while on the web, but i didn't find anything that work properly What i want to do I have a bouncing ball and I want to let the user flick it ...
0
votes
0answers
53 views

How to align angular velocity wit target rotation in 3D?

I'm making a space crew sim (controlling a ship) and have recently posted a question about how to calculate ETA between two rotations. I how now a new question more well defined. Background: I have ...
0
votes
1answer
165 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 ...
1
vote
1answer
42 views

Where is Light in Game view

Very Basic Question.when i run the the game the game Mode is Too dark as shown below in the picture. please suggest me some Setting how to globally switch on built in light while Running the game in ...
1
vote
2answers
68 views

Rotating an object towards a target on the Y axis

I am attempting to rotate a 3D object on its Y-axis towards a target it is looking at. I have always struggled with rotations so I would like to try to avoid using Unity's built in functions, i.e ...
0
votes
1answer
60 views

Handling an item database with procedurally generated items?

Let's say you have an item database which has every item in your game. This works fine for regular items like a Health Potion, a normal Iron Sword etc, because these items have ItemID's so we can get ...
1
vote
2answers
117 views

Can I develop a game for Kinect without a Kinect?

I have to make a game in Unity3D using Kinect. The problem is I don't have the Kinect yet. I need to wait until they deliver it to me. Can I imitate Kinect's movement for debugging my app?
1
vote
1answer
29 views

Unity game in edit the scene mode all of a sudden became incredibly slow/“laggy”

So I recently have been working on a game. So far I have very few assets in the game, which are a point light, a piece of terrain (which is textured), a player controller and a tree. Everything was ...
0
votes
1answer
39 views

Is it possible to tile box colliders without causing “false” collisions in Unity3D?

This is in regards to something like a sidescroller where you have a tiled map where each tile uses a 2d box collider. If you use a 2d circular collider as an example for your character, as it rolls ...
0
votes
1answer
42 views

Problem with NGUI Unity 2D Sprite across devices

I have a problem with NGUI for Unity, using the Unity 2D Sprite objects. First, have this image: And then create an NGUI Unity 2D Sprite object in the scene. Apply this image and you get this: ...
0
votes
1answer
47 views

Can I Debug.Log() on Android without all the callstack spam?

I get this: I/Unity ( 1908): Serialized file length: 754 bytes. I/Unity ( 1908): UnityEngine.Debug:Internal_Log(Int32, String, Object) I/Unity ( 1908): UnityEngine.Debug:Log(Object) I/Unity ( ...
0
votes
1answer
43 views

How to calculate the estimated time of arrival and control signal between two quaternion?

I'm trying to wrap my head around a control algorithm for a space game. If the user sets a target rotation I want to get a ETA counter and show the engine output. The only input to the system is a max ...
0
votes
1answer
30 views

Unity and Chartboost loading problems

I implemented chartboost in my ios game and locally it wors great. I can receive ads. Now my game is online but in the google analytics I get only error messages from the game, meaning the ...
0
votes
3answers
62 views

Backround turning, follow the character

In my Unity2d-platformer, I need background to follow the character, so I just attach it. And when character turn left from right (or right-to-left), background turn too. How can I make my ...
0
votes
1answer
67 views

Migrate from NGUI to Unity UI

I used NGUI 2 and NGUI 3 for our UI. Now want to upgrade to Unity 4.6 and migrate all NGUI to Unity UI. Is there any tools? What's the best practice?
0
votes
2answers
45 views

Speed dependent arc question

I'm currenlty working on an assignment and would appreciate any sort of help on the following implementation The question follows We are tasked to implement some heuristics but one of them is ...
0
votes
3answers
90 views

Creating a unit selection box in Unity (2D)

I've been trying to get my head around how to create a selection box for a selected unit in a 2D top-down type game. When you click on a unit, a small box would appear around that unit based on some ...
0
votes
1answer
31 views

Unity light object not affect some parts of a 3D model

So far I've used Unity only for 2D projects. But now I need to implement a 3D scene in my game. I downloaded a tree model from the asset store and placed it in my scene. I couldn't help but notice ...
0
votes
1answer
65 views

Is normal mapping cpu overhead or gpu overhead?

In Unity3D Engine, I usually apply normal mapping using fragment shader. In this case, this normal mapping is cpu overhead or gpu overhead?
0
votes
0answers
51 views

Keeping object a fixed distance from the ground, buggy behavior

I'm trying to make a script that will keep my object exactly 1 meter from the ground. So far I've got the following code : using UnityEngine; using System.Collections; public class ...
1
vote
3answers
195 views

Create random polygon shapes

I want to make a random shape made out of points. I want the points to create a polygon shape. Is there a clever way to create a random shape like this? Im thinking going throug X points and giving ...
1
vote
1answer
77 views

What is the correct way to raycast on click?

I am using raycast from screen point to detect if the user has clicked/touched on something. The following fails 1/10 times; at first I thought due to the raycast missing the subject below, but after ...