Unity is a highly cross-platform engine that focuses on easy art pipeline process and uses Mono as its scripting back end.

learn more… | top users | synonyms (1)

1
vote
1answer
2k views

GUIText size on 4:3 and 16:9 is different

I have a text (guiText) on the screen. It shows correctly when viewed on 16:9 resolution. But it scales up when viewed on 4:3 (e.g iPhone4). I am using following ObjectLabel script to place it on ...
0
votes
2answers
60 views

Getting neighbors of hex tiles in 3D space

I have a hex tiled model like attached below. Each of the hex tiles are separate objects meaning I can access each of the hex tiles individually inside Unity Now in my program I want to be able to ...
3
votes
1answer
4k views

Problem with default 3rd person controller in Unity 4

I am new to Unity. Whenever I am importing the default 3rd person controller (construction worker) in my scene and clicking the play button, the model seems to be in the running pose. The control ...
1
vote
2answers
63 views

Fastest way to assign sprites to components in Unity

I'm using a sprite atlas and Unity's built-in sprite editor to tease out the individual images. Specifically, I have a single texture containing lots and lots of icons for armor, and I am assigning ...
0
votes
0answers
39 views

Render text on a Quad

I have created a quad with a single color that's rendered on screen as a square, which is fine. I want to add some text to it (or slightly in front of it) that says "Hello". It sounds from reading ...
0
votes
1answer
118 views

Game object position issue in unity3d

I have a set of objects placed on the same layer where all the objects are invisible except one .When i drag an object in to a selected area the current dragged object get destroyed and the object ...
1
vote
1answer
116 views

How to save a Unity prefab on file?

I'm working on a Unity project, and what I'm doing is creating a new scene. In my new scene, I want add some prefabs that there aren't in the project folders, but I can see them in another scene. So ...
-2
votes
2answers
654 views

Making a game engine or using Unity3D? [closed]

I was wondering, which one would benefit me the most? I have as much time as I need to make a game engine and rapid development does not appeal to me. Unity3D is easy, but how much will mastering ...
0
votes
1answer
134 views

VertexColor shader is not working correctly in built application

I want to change the vertex colors of my mesh. The light sources must not affect the objects with this shader, its lighting must be determined only by its vertices colors, so I turned the Lighting ...
0
votes
2answers
163 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
2
votes
0answers
46 views

Transparent diffuse fails to render from all viewing angles

I'm rendering this chunk as a Unity mesh and I have just one material (with alpha) which is applied over all the mesh. Everything in the chunk is automatically generated at runtime, so it's not ...
0
votes
1answer
251 views

Change players state and controls in-game

I'm using Unity 3D Let's say the player is an ice cube. You control it like a normal player. On press of a button, ice transforms (with animation) into water. You control it completely different than ...
0
votes
1answer
66 views

Unity Guitext object always triggering a collision - 2D

I have a guitext object which I can drag. I have attached a 2d rigid body. I have also attached the collider with the following code: void setCollider() { Rect box = ...
-2
votes
1answer
67 views

if statement is executed even when condition is false [closed]

I've made some code that is triggered when the player is in range of the enemy. Everything was working fine until I tried to implement a condition when the countdown reached zero. I made a method ...
0
votes
1answer
46 views

Move camera from wherever camera is to pinned point

So, I need to switch/ move/ animate camera from point X (not point A,as I don't know where the camera is at that momemnt) to point B (place where you want your camera to move). This is for ...
1
vote
2answers
70 views

How to edit colliders in Unity2D

I can edit colliders by holding down the shift key. But when i add a second collider, the shift key always selects the first one. And there is no "Edit Collider" button in the editor (Win/4.5.4f1). ...
2
votes
0answers
62 views

Aligning pathfinding to the center of tiles?

I'm looking to achieve tile by tile movement in a project I'm working on. I employed the use of the asset Simply A* Path-finding to allow a unit to navigate the terrain. Since the tiles are ...
5
votes
1answer
110 views

Multiple SpriteSheets break batching

The problem: I can't fit all my 2d animation sprites for all units and environment in 1 spritesheet. Everything batches fine until I use two spritesheets... I noticed the following : all units from ...
1
vote
3answers
6k views

Unity 3d auto-move player forward script

Trying to write a basic script to attach to the player on Unity 3D, I want them to move forward automatically. I'm guessing that will be part of the Update function and using transform, but that's ...
0
votes
1answer
532 views

Creating a curved mesh on inside of sphere based on texture image coordinates

In Blender, I have created a sphere with a panoramic texture on the inside. I have also manually created a plane mesh (curved to match the size of the sphere) that sits on the inside wall where I can ...
0
votes
1answer
206 views

Make Gameobject Stand On Surface Facing Certain Direction

I want to make a biped character stand on any surface I click on. Surfaces have up vectors of any of positive or negative X,Y,Z. So imagine a cube with each face being a gameobject whose up vector ...
1
vote
1answer
75 views

touch.phase == TouchPhase.Canceled not worked

i m tired to handle and solve issues related to multitouch. i m use maximume 5 touch simultaneously but when two touches are down on two object and i moved my fingures then that both touches fired ...
0
votes
1answer
158 views

Unity-Animation parameters are not being set

I have the following animation controller: with two parameters of walkingSpeed and Jump. I have the following code which should change the values: animator.SetFloat("walkingSpeed",0.9f); ...
1
vote
0answers
50 views

Square tile navigation unity

I'm looking to generate a grid style navigation system in Unity. I have created a map in Tiled and am unsure how to continue considering the tiles will have different properties. The closest example ...
1
vote
2answers
105 views

Why should I use getcomponent?

I have already referred the animator by using the statement, Animator anim; But,What is the use of getcomponent in awake() function.What happens without it.
0
votes
1answer
357 views

How do I add a Rigid body and a box collider component to a Texture2D?

I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels. All snake head, piece, food, even the background is made of ...
0
votes
0answers
91 views

Unity 2.5D Character Movement

I'm wondering if anyone can point me in the right direct as to how to take a 2D character/sprite in Unity and have said character turn corners in a 3D style. Solutions or resources welcome.
0
votes
1answer
145 views

Why do camera's aspect ratio look good on computer but not on Android devices?

I'm developing a game for Android devices and I have a script that solves the aspect-ratio problem for computer screens but not for my intended target platform. It looks perfect on computer, even when ...
0
votes
1answer
42 views

In Unity how can I know which direction is the screen auto-rotated?

From the Screen.orientation description I get If the value is set to ScreenOrientation.AutoRotation then the screen will select [...] automatically as the device orientation changes. This seems ...
0
votes
0answers
45 views

Very strange trigger behavior in Unity2D (4.5)

I am developing 2d platformer and I've faced with a very strange triggers behaviour in Unity. I have made the enemy that can throw objects into main player. So I have made two empty GameObjects with ...
0
votes
1answer
138 views

Move a sphere along the swipe?

I am trying to get a sphere curl based on the swipe. I know this has been asked many times, but still it's yearning to be answered. I have managed to add force on the direction of the swipe and it ...
-2
votes
0answers
25 views

What licenses will I need for publishing my game? [duplicate]

Me and a friend have started developing a game in unity and now it's time for getting models for our games, and the question is, if we want to use for example 3ds Max for making the models for our ...
1
vote
0answers
42 views

Unity 3D Photon Network wait for all buffered RPCs to be called

I am having a lot of fun with the Photon Network asset, and I'm having this issue where I need to instantiate the players at different spawn spots, but not in a random way, instead I thought it would ...
0
votes
1answer
240 views

Simple heart container script for 2D game (Unity)?

I'm attempting to create a simple mobile game (C#) that involves a simple three-heart life system. After searching for hours online, many of the solutions use OnGUI (which is apparently horrible for ...
4
votes
2answers
70 views

What's the point of [HiddenInInspector] (as opposite to [NonSerialized])?

I understand the difference between [HiddenInInspector] and [NonSerialized], what I'm missing is the use case for [HiddenInInspector]: so far every time I've encountered it, it was used by developers ...
0
votes
0answers
39 views

(Unity 3D) Why are bone colliders with an Animator Controller so finicky?

I have an NPC with colliders parented to its bones using the Unity ragdoll wizard. It also has an Animator Controller. The problem is, sometimes those colliders just don't work right. They're targets ...
0
votes
1answer
71 views

Doing imagemagick like stuff in Unity (using a mask to edit a texture)

There is this tutorial in imagemagick http://www.imagemagick.org/Usage/masking/#masks I was wondering if there was some way to mimic the behavior (like cutting the image up based on a black image ...
1
vote
1answer
2k views

How can I translate a game object towards a position?

I am instantiating my game objects (spheres) through scripts. I want my spheres to move from one location to another. but I don't know how to do this. Update is called once per frame. Is that what I ...
1
vote
2answers
91 views

Trying to better understand Unity gameobjects

New to Unity, but develop in C# normally. I can't seem to get how / why / where to grab certain elements. For simplicity, I have a top-level game object, say a cube. I add a sphere to the scene as ...
-1
votes
1answer
39 views

Finding and reading a script on a mouse-selected GameObject

I can't work out how to access and read changes in a script of a gameObject that has been selected. The script selects enemy objects with right mouse button and player objects with left mouse button. ...
0
votes
0answers
51 views

Implementing a group formation behavior

I am trying to implement a group formation behavior where all the units in my group follow a leader and maintain their position throughout. So far I am able to move them, rotate and follow the leader. ...
2
votes
1answer
127 views

change texture at runtime

How can I change the texture at runtime. I have done changing the label(text) at runtime. The following code is used using UnityEngine; using System.Collections; public class switchtime : ...
2
votes
2answers
57 views

How to unpause a particular gameobject in unity?

Say, I have a GUI Menu attached in a game scene. The game will be in pause state by default. I did it by setting "Time.timescale=0.0f"; I want my game to unpause only when Play button clicked. My ...
1
vote
2answers
484 views

Why is mesh baking causing huge performance spikes?

A couple of seconds into the gameplay on my Android device, I see huge performance spikes caused by "Mesh.Bake Scaled Mesh PhysX CollisionData" In my game, a whole level is a parent object containing ...
2
votes
0answers
35 views

Copy a folder in Assets/Resources folder programatically depending upon a constant

I have a Unity3d project in which I have 200 games and some 350 scenes. Now I want to make separate builds for each game. All my assets are present in Assets/IgnoredAssets/ABC folder. To include these ...
2
votes
3answers
306 views

Why are my Unity procedural animations jerky?

I'm working in Unity and getting some crazy weird motion behavior. I have a plane and I'm moving it. It's ever so slightly getting about 1 pixel bigger and smaller. It looks like the it's kind of ...
-1
votes
1answer
34 views

Recording time since last collision

I am trying to record time since the last collision happened.But this is not working as I expect it to. So, numberLimitOfCollision is equal to 0 only in the begining, Basically, what I am trying to ...
1
vote
1answer
145 views

A problem with texture atlasing in Unity

I have the texture below and I need to get rectangular parts from it. I could finally combine meshes of different quads to improve performance, but I with quads of different tilings, this means ...
-2
votes
2answers
92 views

How to increase speed of GameObject? [closed]

I'm making pong game in unity3d with monodevelop(c#). I want to increase speed of ball when it touch ends of paddle corner. my ball script: using UnityEngine; using System.Collections; public class ...
1
vote
0answers
114 views

Unity 3d 4.6b New GUI system doesn't take touch when already a touch event is occurring in 3d scene

I know this is beta version but.. I have a Canvas->Button which works fine when I tap it normally. I have a joystick in my scene which is drawn by separate camera other than mainCamera. now, while ...