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)

2
votes
1answer
76 views

How to remove a component of an object in a script?

I want to remove a Sphere Mesh Renderer component from a certain gameobject. I want to do this in a script. How do I do it? I do not want to destroy the sphere itself, just the component
0
votes
1answer
21 views

(Unity) Drag and detect object below when dropping

I'm studying game development in Unity and I want to create a idle/clicker game like Cow Evolution. I'm using OnMouseDown, OnMouseDrag and OnMouseUp to move the GameObject around the scene. Now I ...
0
votes
1answer
46 views

How to achieve a for loop without Unity crashing?

I want to make a for statement that repeats constantly until a stop variable becomes "1". But wherever you type a "for" statement in any way or even without anything in the statement, Unity just ...
5
votes
1answer
68 views

How can shader code duplication be reduced in Unity?

In our current Unity project we have a few shaders that are basically just supersets of another shader. For example, we have a shader that performs lighting calculates with diffuse, normal, specular, ...
0
votes
1answer
17 views

How to check if an GameObject exists in Unity2D? (Javascript)

Im making an AI that checks if the player exists or not. How do I check if a certain object exists and put it in a boolean variable?
1
vote
1answer
50 views

Restricting body movement withing a specific length while dragging a gameobject in unity

private void OnMouseDrag() { Vector3 screen_sp=new Vector3(Input.mousePosition.x,Input.mousePosition.y,screen_space.z); Vector3 cur_pos=Camera.main.ScreenToWorldPoint(screen_sp)+offset; ...
1
vote
1answer
19 views

How to revert to MonoDevelop's old “ctrl-tab” behavior? [closed]

I believe MonoDevelop (bundled with Unity3D) has changed its ctrl-tab and ctrl-shift-tab behavior and I would like to get back to the old behavior, as the new way frustrates my workflow. Ctrl-tab ...
1
vote
2answers
30 views

Proper way to handle Movement/Animation/AI functions of an AI character in Unity3D

My team is currently building a 2D game in Unity and we've run into some workflow/script organization blockades for many of our game's characters. For example, we're not sure what the standard method ...
0
votes
1answer
18 views

Unity: “Find” can only be called from the main thread, but moving variables to the Start() function causes other errors

#pragma strict var collided = false; var thrust: float; var pizza = GameObject.Find("pizza-small").GetComponent.<Rigidbody2D>(); function Start() { } //hand + pizza ...
2
votes
0answers
53 views

Volumetric grass

I've been extremely interested in volumetric technology. Especially in volumetric grass. The online resources are extremely scarce on this topic. What is the difference from creating a lot of ...
1
vote
2answers
30 views

On key press, spawn a collider where my player is facing?

I'm trying to create an attack mechanic to my player hero in my 2D Tower Defense game. When I press the Q button I want my hero to do an animation and spawn a temporary collider shaped as a cone at ...
0
votes
2answers
35 views

I need an object to move towards an moving object in Unity2D (javascript)

I am trying to make an AI that tries to move towards the player but I don't know how. I tried using Vector2.MoveTowards() but it just mimics my movements instead of moving towards the player. I tried ...
0
votes
1answer
33 views

How to get a Vector2 location of an object? (Unity2D javascript)

I need to make an "AI" that makes a ball try to touch the player. But Vector2.MoveTowards()needs a Vector2 variable but how do i get the location of an object?
0
votes
1answer
10 views

How to use rigitbody2d.AddTorque() in JavaScript? (unity2D)

I just want to know how to use rigitbody2d.AddTorque() and an example script would be great :D. I am trying to rotate a cube forever using it as a test.
0
votes
1answer
31 views

Can't see instantiated UI element

I'm trying to create a level editor for a 2D game and I wanted to instantiate radio buttons, the backgrounds and numbers of which are determined by the tilesheet I load. I'm sure I'm doing something ...
0
votes
2answers
54 views

Generate static 2D Tilemap from array

How do I generate a 2D tile map from an array like in this tutorial for XNA ? I basicly want to generate a static map based on my tile prefabs.
0
votes
1answer
31 views

Unity 5 Server Side Physics - Alternative to constant position update?

I am looking into reducing load in client server games for a uni project and am looking at physics. The idea is that if a very low powered device tries to carry out some physics heavy action that it ...
0
votes
1answer
21 views

Quaternion.Lerp doesn't rotate object with exact degrees

I want to rotate my object 90 degrees with Quaternion.Lerp when user press the upArrow. But after each rotate I can see that it does not rotating my object exactly 90 degrees. approximately 88 degree ...
0
votes
1answer
30 views

Unity draw part of sprite sheet

Im working in Unity and im finding the animator isnt working for what im trying to do in my 2d game. What I want to do is build a specific animation using sprite sheets, then be able to reuses that ...
0
votes
1answer
37 views

Invalid AABB aabb

Invalid AABB aabb UnityEditorInternal.InternalEditorUtility:CalculateSelectionBounds(Boolean, Boolean) I've got this error when I place any convex mesh collider in scene. What does it mean? Game ...
0
votes
0answers
24 views

Unity3D LLAPI and Pyhton UDP communication

I need a Unity3D game on Android to receive UDP packages from a Python script running on a different device. Using System.Net is not (yet) an option, as it is only supported on Android with a valid ...
1
vote
0answers
123 views

How should we begin to create our 2D Tower Defense? [closed]

Me and my friend are going to make a 2D Tower Defence game as our last assignment in highschool that has to be finished april/june next year. We both know a handy bit of Java and C# but our game is ...
0
votes
1answer
31 views

Collision in EdgeCollider Unity

I want to make a collider for a line that I've drawn on the screen using mouse. so the detection should be cover the whole line that has drawn. What I've learned from edge collider is you can have ...
1
vote
3answers
101 views

How to build a spaceship with interior in unity?

I've begun to study a unity engine in one purpose: I have a great multi player game idea! The main essence: In space there are two (or even more) huge spaceships with crew consisted of players (all ...
-2
votes
1answer
50 views

How to remove this NullReferenceException in Unity

NullReferenceException: (null) UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs) (at C:/BuildAgent/work/812c4f5049264fad/Editor/MonoGenerated/Editor/SerializedPropertyBindings.cs:39) ...
1
vote
2answers
88 views

Is it possible to have a GUI in world space in Unity3D game?

I'm trying to make a tank shooter game for learning purpose and I want to have it viewed in first person, is there a way to make it so that the GUI seems projected onto the interior of the tank ...
1
vote
1answer
44 views

How to do offline notifications for Android in Unity3d

I am making a game for Android with Unity3d. I've been looking for a solution to this on the web for a little, but I couldn't find anything suitable: I want to make my game have offline ...
4
votes
3answers
491 views

Unity 5 disabling a script

I'm using Unity 5 and want to disable a script called Unit based on whether the instance is a client or a server. I have tried using: GetComponent("Unit").enabled = false; However I get hit with ...
0
votes
1answer
24 views

GUI.DrawTexture problem in Unity

I'm having a problem with GUI.DrawTexture() and I'm looking an alternative function to draw 2D Texture Images. The problem I have is that my textures draw above all other objects and when my camera ...
2
votes
1answer
15 views

Unity3D (5.1) NavMesh Agent Error

This is my first post in GameDev StackExchange, so please excuse me if I make any mistakes on best practices here (if I do, please refer me so I can learn). I'm making a prototype where I have 2 ...
0
votes
0answers
21 views

Using unity's car ai for enemy tanks or creating a simple vehicle ai?

I'm creating a simple game that you are a guy with anti tank / rpg-7 and you have to destroy waves of enemy tanks and jeeps that come toward you. Do you think it is an overkill to use unity's car ai ...
2
votes
1answer
34 views

Make a plane to display material from both sides

I know there is a setting in Cry Engine, which allows you to be able to read materials of the plane from both sides, so I am wondering if there is such a setting in Unity5. Thanks in advance
0
votes
2answers
67 views

Player in Spaceship

I want to realize space game on Unity3d engine. There are some huge spaceships in the void. So, I want players flying in space in weightlessness, but when they go inside any spaceship, they will be ...
-2
votes
1answer
47 views

I cannot move a gameObject in my scene

I am trying to move a cube to the right in my scene with this piece of code, but it does not work. What is the problem? using UnityEngine; using System.Collections; public class Jump : MonoBehaviour ...
0
votes
1answer
8 views

Unity3D (2D) - Make sure Item Dragged Is Top Item Visually

I am using Unity 5 and making a 2D game in which many sprites will be stacked on top of each other and can then be moved by dragging. Sometimes when the users goes to drag from a pile, ones that ...
-2
votes
0answers
26 views

Does this place support Blender questions [migrated]

I am new to Game Development and I am studying game programming in India. I learn game designing via YouTube and other online sources. Where can I ask Blender related questions?
0
votes
1answer
24 views

accelerometer not working unity

why is the cube moving when I use a controller, but not with the accelerometer? void Update () { text.text = "X: " + Input.acceleration.x + "; Z: " + Input.acceleration.z; ...
0
votes
0answers
46 views

2d pixel art in isometric 3d world

I've been working on an isometric game and I'm using 3d to simplify collisions and also I heard it was just a better idea. My art is 2d sprites, so I've been using billboarding to render them. It ...
1
vote
0answers
16 views

How do i change the vertical fit of a constant size fitter?

How do i change the vertical fit of a constant size fitter? For example changing vertical fit from min size to unconstrained. Is it posible to do this?
2
votes
1answer
49 views

How to move on iTween path when a button is clicked

I have set the iTween path and also I have added a button. When I click on the button the object should start moving along the iTween path.But issue I'm facing is when I run my project at initial ...
1
vote
4answers
58 views

Moving Object on One Axis

Hi Im trying to move some 3D text on one axis, but for some reason it moves on 2 with this code. Can someone explain why this is/ how to fix it? Maybe this is a simple solution but i cant find it. ...
0
votes
1answer
18 views

Having trouble with a trigger zone. How do I make it so that it deletes certain objects, but ignores others?

I'm trying to setup a system where I pickup an object drop it into a zone, and then the object is destroyed. So far I have: using UnityEngine; using System.Collections; using UnityEngine.UI; ...
0
votes
0answers
33 views

UI Element in World Space OverrideSorting

Let me explain my problem. From a database I create buttons (around 40) in a World Space. The problem is that some buttons are displayed in front of other. (screenshot) Personally I would like the ...
2
votes
2answers
54 views

Instantiation of a GameObject not working for a threading reason

I receive the following error "INTERNAL_CALL_Internal_InstantiateSingle can only be called from the main thread." "Constructors and field initializers will be executed from the loading ...
0
votes
0answers
40 views

AssetBundle not working properly

I am using Unity 5.0.1. I have created the asset bundle of a sprite by selecting the name "img.unity3D" from the dropdown and then running the script : BuildPipeline.BuildAssetBundles ...
0
votes
0answers
8 views

is edit tangent possible in 3dsmax?

I have a custom hlsl directx shader, it takes vertex normals for rim light calculation. and vertex tangent(it stores unified normals) for edge render(enlarge model & cull front). I can export ...
0
votes
0answers
24 views

Enlighten interfering with smartfox user objects

This code is checking if a userID matches any id in a SFSUser List: foreach(GameObject element in connectedPlayers){ if(element!=null) { ...
0
votes
1answer
29 views

UNET Error handling

I am trying to handle errors received by a UNET (new Unity3D networking) client. The below code successfully connects to a server when it is present, but obviously gives a timeout error when there is ...
2
votes
3answers
33 views

Get OnMouseDown to work with a 2D Polygon Collider

I'm having a hell of time getting a 2D polygon collider to register a mouse click. I've attached images and code to show where I'm at. I cannot get the click to work. Ultimately, the thing I'm trying ...
2
votes
1answer
150 views

Creating Fog Of View in 2D game with lighting method

I'm creating 2D side scrolling game with Unity, and i want to add feature where the player come into a cave, then all going dark, the player turn on the flash light, so the player can see around ( ...