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)

1
vote
1answer
30 views

Unity polymorphism in editor through a list

So I have an ItemDatabase class which basically only has a list of Item public class ItemDatabase : MonoBehaviour { public List<Item> Items = new List<Item>(); } The Item class ...
1
vote
1answer
24 views

Detecting a 3 x 3 grid and extracting its coordinates using Kinect

I'm interested in creating a DDR (dance dance revolution) game using unity3D and Kinect. However I need to do this without actually using a pressure sensor pad, just a mat with grids and numbers on ...
0
votes
1answer
56 views

Can Java be used for developing games for Android in Unity3D [duplicate]

I only know Java Programming Language and no other. Can I develop games for Android in Unity3D using Java?
0
votes
1answer
77 views

StartCoroutine inside TriggerOnEnter2D isn't working

I am new to this, but I need help with a CSharp script. I need to collide with the desired object, pass the game to be 1.6 in TimeScale. After passing 8 seconds in the game, change back to 1 ...
1
vote
1answer
33 views

Lists of concrete types show up in inspector, but not lists of interfaces

In one of my custom C# classes in Unity, I need to expose a List of objects in the inspector, and they need to conform to a specific interface. Below are two lines from my class definition. Card is a ...
1
vote
0answers
17 views

Unity Javascript GUI.Button shows up twice

Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts. However for some reason it prints each button twice to the screen, once with my custom style, and once ...
0
votes
1answer
43 views

Unity 5 Animator controls - What are their Unity 4 correspondent?

I am following a tutorial that is made with Unity 5, but claims to be compatible with Unity 4.6 I am working with the Animator panel, and I was wondering where could I find certain controls on the ...
0
votes
1answer
44 views

How to reference the right object in Unity

So, I'm developing this small 2D project where I have a sphere that detects if objects get close to it from three different directions. I have successfully found a way to detect if an object ...
0
votes
1answer
40 views

Animator Panel in Unity - Where is “Entry”?

I am following a tutorial on Unity, and I saw a screenshot like the following: When I reproduced the steps of the tutorial, I realized that the green "Entry" box was not present on my screen. I ...
0
votes
0answers
56 views

Generating a NavMesh / Point Graph for 2D Procedural Platformer Levels

I am trying to create an algorithm which handles a NavMesh / Point Graph Generation for 2D Procedural Platforms Level in Unity3D. The reason why I say NavMesh / Point Graph is I don't know which one ...
0
votes
1answer
58 views

Controlling roll rotation when travelling along bezier curves [Unity3D]

I am currently working on implementing a curve implementation for use in Unity which includes an editor: The aim is to get an object to follow the path represented by the curve at a constant ...
0
votes
1answer
30 views

Getting distance between point of an object and another object in Unity

First, I'd like to apologize because this is a very basic and repetitive question, but I am completely new to game development. I understand that I can find a distance between two objects using: ...
0
votes
2answers
92 views

Realistically drivable car

I want my car to be realistically drivable (like in real life...) Unfortunately all I did so far is Rotate the whole vehicle using A and D; and AddForce in forward-backward direction using W and S ...
0
votes
1answer
22 views

Maya keyframe animation to unity

Sorry guys! I am super new to this, and I'm trying to teach myself Unity. I have a very small knowledge of Maya from a 3d modeling course I took a year ago in college, and have made a very simple ...
0
votes
1answer
22 views

Unity joystick input acting strange

After setting up my joystick axes in Unity and sweeping them around I find that the Y-axis jumps to the opposite direction in certain positions. So, when I press up on the joystick, the input will ...
1
vote
3answers
79 views

unity destroy enemy when jumping on it

I am creating a 2D platformer using Unity3D, I want to have the player destroy enemies when it jumps/falls over them (just from the top). But I have been having problems trying to implement this. I ...
0
votes
0answers
24 views

What variables change the number of lightmaps

I need to know what changes the lightmap size for example what changes the lightmap from being 2*1024*1024 to 4*1024*1024 , having larger textures or having larger quads(having more models) or having ...
0
votes
0answers
51 views

How can I make several 2D objects move in complex pre-defined patterns?

I will be making my mobile 2D game in Unity and the objects in the game will have complicated movement. For example, there will be lots of squares (around 10-15 tiny squares) in the middle of the ...
0
votes
1answer
49 views

Are lightmaps also considered textures?

I want my game to support phones with max texture size of 1024 so my texture atlases are 1024. My question is: are lightmaps also considered textures and their max size must be 1024? Or they can have ...
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
48 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
91 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
98 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
73 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
24 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
79 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
431 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
86 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
169 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
119 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
112 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
72 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
42 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
88 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
71 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
55 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
53 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
70 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
84 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
49 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
55 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
185 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 ...