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
60 views

How can I move game objects using keyboard in the Unity scene editor?

I know I can click on the "move" button and use my mouse to drag the object around. How can I do the same using my keyboard?
10
votes
4answers
298 views

How could I constrain player movement to the surface of a 3D object using Unity?

I'm trying to create an effect similar to that of Mario Galaxy or Geometry Wars 3 where as the player walks around the "planet" gravity seems to adjust and they don't fall off the edge of the object ...
2
votes
1answer
32 views

Find asset labels at runtime

Unity allows me to add multiple labels to my assets in the editor (the little blue luggage tag in the corner of the inspector). I can use the Asset Database to find all assets with a certain tag from ...
3
votes
2answers
115 views

How should I organize my Unity scene graph?

In programming, we have coding conventions — self-enforced rules to help maintain order. Does such a convention or consensus exist on how to lay out scenes in Unity? I've seen two styles of ...
1
vote
1answer
61 views

How to securely retrieve game stats from clients in a p2p game network?

I'm working on a P2P game and I know I should never trust the clients. I my architecture, there is a "Master Server" that stores game room (host) informations. Players can create their own rooms ...
1
vote
2answers
53 views

Collision between Mesh Plane and 2D Sprite

I've just recently started programming using Unity and made a couple of games with it, I'm trying out more and more advanced stuff as I do more games, but right now... I'm trying to make a game ...
3
votes
2answers
69 views

How can I detect continuous touches/pressed with Unity 4.6's UI elements?

I've recently switched to Unity 4.6. My previous workflow when creating continuous-input controls (the kind where you measure continuous touch input on a single button) was to create a GUITexture and ...
-1
votes
1answer
37 views

Float increment give wrong result [closed]

I found something weird with my unity code : public class heroesscript : MonoBehaviour { float counter = 0; void FixedUpdate() { counter += 0.02f; print (counter); ...
1
vote
1answer
36 views

How to access an animation properties from the animator?

I'd like to change the property speed of an animation from the animator. For example, I'd like the player to be able to reload faster with upgrades. So I have a basic reload animation on the gun ...
1
vote
0answers
36 views

How do I fix the duplicate files problem in MonoDevelop?

MonoDevelop-Unity counts some files twice in a project of mine. This is very annoying, both for the "go to declaration" feature, and for the search (who finds twice anything who it would find). Not ...
1
vote
0answers
30 views

import text strings into Unity editor 3D text objects so that Scene View displays them

I am having trouble finding a solution to this problem. I want to generate the text for TextMesh.text in a custom application and import into the Unity editor so that I can then scale the text to ...
-1
votes
1answer
57 views

Yeild waitForSeconds(5.0) is not working

I am trying to call another function continuously from my Update() function. So, I have used yield WaitForSeconds(5.0); but, the it stops for the first 5 seconds and it does not stop the next time it ...
0
votes
1answer
55 views

Why does this code not update my object's position?

I am trying to move the object in my frame in Time.deltaTime. I have not taken care the speed yet but the problem is, the object is almost at position (0,0) after I have multiplied the x & y axis ...
0
votes
2answers
65 views

What is the best practice for handling touch events on different GameObjects in Unity2D?

First of all I want to describe what I have in my scene. 1. Joystick. 2. Main character that has link to joystick and handles touch events from joystick. 2. Buttons. 3. Other GameObjects that must ...
0
votes
1answer
37 views

Unity Button Without an Image?

I want to create a button whose clickable area is only specified by a BoxCollider with Unity's new UI (similar to how you would do it from within NGUI). I can't get a Unity Button to work without the ...
0
votes
1answer
56 views

Unity Player Prefs Deserialization not working in web build but is working in the editor [closed]

for some reason i can deserialize in the editor just fine with player prefs but when i make a web build it simply doesn't work. and since there's no real console log, i can't get any useful feedback. ...
2
votes
0answers
37 views

Unity Render Texture Artifacting

I'm having weird black artifacts appear on my render textures when they are transformed while the game is running. I am using a ScrollRect as a scrolling container for buttons (the buttons are just ...
2
votes
1answer
70 views

How can I make Network.RPC call a method with params object[]?

Why do I need to do this? The game I'm working on fully conforms to a component style design. Every component that a game object uses is placed on the object and is disabled/enabled based on it's ...
0
votes
1answer
29 views

Camera bounds grow along with the game scene editor in Unity

I am extremely confused by the Unity editor. Look: I have an image, And I want my camera to fit it perfectly. I have achieved so by using a size property of 540: Notice how the viewport rect ...
0
votes
1answer
22 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 ...
1
vote
0answers
35 views

Setting the main camera's size to be equivalent to the device's width and height

Making a 2D game with Unity. I need a way to set the main camera's width and height to be equal to the mobile device's resolution. So if you're using an iPad Mini 3, then the main camera will be 2048 ...
2
votes
1answer
56 views

How to output to the Oculus and a 2D screen?

We'd like to present an Oculus game to a large group of people. Not everyone will have an Oculus headset, so we'd like to output to both the Oculus and a second display. The problem is that the ...
0
votes
0answers
36 views

How to embed UnityScript for scripting in Unity3D?

It is useful to have parts of your game being scriptable. Many people (especially outside of Unity) are using LUA for that job. As UnityScript (as with Boo or C#) is a first class citizen why not use ...
0
votes
1answer
38 views

Unity: Built In Scrollable Containers?

Is there a way to get a scrollable container in Unity without purchasing a plugin such as NGUI or TK2D? I want to create a scrollable container of interactive elements that can be clicked on ...
0
votes
2answers
99 views

How to reverse gravity in Unity

I'm trying to figure out how script gravity reversal on collision with an object. How can I reverse gravity?
0
votes
1answer
49 views

Casting a directional line of which an object is coming from

I want to create a directional line ( curve / linear ) depending where the direction is coming from. In some games, similar to Angry Birds, a dotted guideline is shown to provide where the gameObject ...
4
votes
1answer
288 views

How is a Game Manager supposed to be constructed?

I'm a beginner developing games on Unity3D and now that I've become a little bit familiar with GameManagers I've been wondering about certain aspects. How do you contruct a GameManager in the most ...
2
votes
1answer
62 views

How to put the game object to the upper left corner of the screen in Unity and make it visible entirely on all screens of mobile devices

I have game object which displays health indicator in my 2d video game in Unity. This gameobject contains a lot of sprites and i put it into left/top corner of the screen. In my game editor it is ...
1
vote
1answer
103 views

How can I resize my Blender models when importing to Unity?

I made a 3D model in Blender, but when put it in my Unity project and add an FPS-camera the camera is bigger then my model. I used the measurements of Blender (that one cube is 1 meter in Unity). How ...
0
votes
0answers
30 views

Unity3D C#: How to resize an inputfield according the content which is set dynamic

I've got an InputField where the text is filled in upon getting a string back from the server. We can debug the entire text so we receive it correctly. However the text is too long to fit in our ...
0
votes
1answer
40 views

Unity3D : Unity fails to detect null objects

im instantiating an object which is gonna play the background music for my game. On the Awake() function I check if there is a gameobject with the tag "MusicPlayer" on it, and if there isn't any I ...
0
votes
2answers
95 views

How can I move objects pixel by pixel in the scene editor?

I'm trying to find a way to move objects pixel-by-pixel(on my screen at least) in the scene editor. I tried a lot of different buttons but nothing seems to work, please tell me Unity has this ...
-2
votes
1answer
45 views

Joystick control for camera only works when button pressed

I'm trying to use a controller that has a joystick. I'd like to move the camera when the player moves the joystick. The joystick also has a button. So far I'm only seeing the camera move when the ...
0
votes
0answers
22 views

Creating a ray with angle movement restrictions

In Unity is it possible to create a ray which has movement restrictions. As in creating a ray which is fixed to one point. When this point is moved around. The line is also moved around. But when the ...
1
vote
1answer
56 views

Unity Raycast shoots right through some objects

I made a melee combat system for my game. The code looks like this: var hit:RaycastHit; if(Physics.Raycast(transform.position,transform.forward,hit)) { if(hit.distance<=2.0) { ...
0
votes
1answer
57 views

(Unity)How to make the BGM not stop between scenes

I want my BGM to keep playing on loop, but whenever I transition into another scene, the loop starts over. Is there any way to have the scene record the last point of the music it plays, and in the ...
0
votes
1answer
25 views

Destroy a single list member

im trying to destroy a single game object using the following script but it destroys all of them , not the ones I want. I want to destroy the ones that the transform that holds this script collides ...
0
votes
1answer
53 views

Finding a moving target in a maze

I'm making a game that is a bit of a mix of snake and pacman. Basically, two players go through the maze and each time they pick up a piece of candy, a cube is added to their tail. If one player ...
0
votes
2answers
106 views

How does Vector3.Angle compute the resulting angle?

I don't understand the concept of Vector3.Angle in Unity. Can someone please explain in detail how it computes the angle? From which two points is the angle measured? It would also be really awesome ...
0
votes
1answer
92 views

Jump Issue(Unity3D)

This is my first character control script. Where a cube is my player and the objective the i want to achieve with my script are 1.the cube moves in horizontal axis till the button is pressed once ...
0
votes
0answers
26 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
0
votes
1answer
60 views

Find index of GameObject in array of GameObjects

In my script, i have declared an array of GameObjects like this: public GameObject[] go;ld object name. `String temp;` Also, i have a temporary variable to ho Then, i assigned objects to elements ...
3
votes
1answer
327 views

How can I separate component functionality from networking logic?

Is it possible to make network independent components that allow networking details to be specified externally? For example, if I have a "Follow" script that follows a game object, it would need to ...
1
vote
1answer
30 views

How to transform Unity terrain coordinates

My map creator created some terrain in Unity, but all my scripts are based on the X-Y axis. Is there an easy and smart way to transform them into Z-Y, or do I have to change all the vector variables ...
0
votes
2answers
69 views

How can I make animations “snap” between transitions in Unity?

I have an animator with a few animations in it. These are very basic animations, just changing a transform to slide a sprite around in a cutscene. The issue that I'm running into is that when I ...
2
votes
1answer
106 views

How do I change a Unity 4.6 Sprite's textureRect at runtime?

I'm using Unity 4.6, and I've made a sprite like this: AtlasFrameData frame = _testAtlas.GetFrameByIndex(0); Rect spriteRect = new Rect(frame.Position.x, frame.Position.y, frame.FrameSize.x, ...
3
votes
1answer
270 views

Change unity physics engine speed

Is there a simple way to change the speed* of unity's physics engine like in the game SuperHot? Any script language is ok but javascript is preferred. *I am not sure if speed is the correct term.
1
vote
1answer
62 views

Environment collision in a pseudo-3d 2d space

The game is a 2D brawler with depth movement in the vein of Golden Axe, Final Fight, Castle Crashers etc. Characters and environment are all 2d sprites as well. I've had no real issue setting up ...
0
votes
1answer
28 views

Unable to instantiate objects Straight in unity

I am creating a match card game in unity and I want to place cards in straight direction that is one below another and so on... But with my formula It's showing cards one after another.Please tell me ...
3
votes
1answer
77 views

How can I consistently identify location on a mesh from a raycast hit?

I am using RaycastHit.triangleIndex to identify a location on a mesh (very low poly). However, I have discovered that a given triangle on the mesh does not have the same triangleIndex value from one ...