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)

17
votes
1answer
966 views

Why do I seem to lose control of my computer when full screen Unity game loses focus?

When I press Ctrl+Alt+Esc or Ctrl+Shift+Esc the game loses focus, but then the whole PC is unusable and I need to restart the PC to regain control How do I prevent the computer from locking up (let ...
14
votes
3answers
3k views

How to avoid movement speed stacking when multiple keys are pressed?

I've started a new game which requires no mouse, thus leaving the movement up to the keyboard. I have tried to incorporate 8 directions; up, left, right, up-right and so on. However when I press more ...
2
votes
0answers
82 views

How to do z-index parallax in 2D game in unity3d

I am new to unity3d and want to develop a simple game like crazy cabie. For which i have to implement a z-index parallax for moving sprites towards the player and generating new sprite a farthest z ...
2
votes
2answers
192 views

Executing Components in an Entity Component System

Ok so I am just starting to grasp the whole ECS paradigm right now and I need clarification on a few things. For the record, I am trying to develop a game using C++ and OpenGL and I'm relatively new ...
1
vote
0answers
80 views

Ease Rotate RigidBody2D toward arbitrary angle

I'm trying to make a rigidbody2D circle return to an orientation after a collision. But there is a weird behavior I do not expect - it always orients to the same direction. This is what I call in ...
1
vote
1answer
60 views

Align tetrahedrons

I'm currently generating tetrahedron meshes in Unity When a player clicks the side of a mesh, a new one spawns aligned with it, like this. I'm not sure how nor can I find any information on ...
-1
votes
1answer
41 views

How to use lemodev highscore plugin for unity?

I am trying to add a server-sided highscore system to my game in unity. I have downloaded the free lemodev highscore plugin from the asset store but I cant figure out how to use it. I know where to ...
-2
votes
1answer
75 views

How can i export unity games to android?

I'm using unity 4.0. I want to build games for android. When I click build it opens a select folder dialog box and wants an apk name. But after pressing select it does nothing. Simply the dialog box ...
0
votes
1answer
305 views

Simple collision detection in Unity 2D

I realise other posts exist with this topic yet none have gone into enough detail for me. I am attempting to create a 2D game in Unity using C# as my scripting language. Basically I have two objects, ...
1
vote
1answer
56 views

Unity Problem with colliding instances of same object

I want to check if object's instance is overlapping with another instance (any spawned object with another spawned object, not necessary the same object). I'm doing this by detecting collisions ...
3
votes
1answer
113 views

Characters With Interchangeable Skills

I am using unity and I would like to create characters that have interchangeable spells. As an example it would be something like Pokemon that can attain different skills as they level up and the user ...
4
votes
1answer
206 views

Dealing with numerous, simultaneous sounds in unity

I've written a custom class that creates a fixed number of audio sources. When a new sound is played, it goes through the class, which creates a queue of sounds that will be played during that frame. ...
0
votes
1answer
222 views

How can I make my player move in the direction the camera faces?

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
3
votes
1answer
115 views

Simulating Smartphones on PC with Unity

I want to make a game that depends on the phone orientation (changing shoot direction with tilt), however I need to test this on PC. So is there any tool I can use to simulate the orientation of the ...
1
vote
1answer
67 views

Warp GameObject Size When Entering/Leaving Area

Below I have an image describing the desired functionality I am going for. Let's say you control a square and when you move this square into a given area, any part of your rigidbody/model inside of ...
2
votes
3answers
82 views

How to generate arrays of item types knowing just the ratio of distribution

I'm stuck to find a good solution about spawning enemies. Think of it as a tower defense game. What I'm trying to do is: Create keypoints for enemy types and spawnrates, as Wave0 = Enemy0 * 1.0 ...
4
votes
1answer
187 views

Prefab random rotation in editor

Is it possible to automacicaly random rotate pefab during placement in editor in unity 4.5.3? I can make it autorotate in game(at start) but I want it to be visible in editor and at fixed rotation ...
0
votes
0answers
47 views

different screens and cropping problem

I have an image that look like this in unity: but in my htc desire 500 mobile phone look like this, even in my tablet: it crops a lot. In landscape mode it is better but i have the same problem. ...
0
votes
0answers
73 views

Looping Background in Unity

I am currently learning C# with Unity 2D but I have come across an issue after following a tutorial. I am trying to get my camera to follow my player within the game but also to get my background ...
0
votes
1answer
35 views

Enabling Unity GUI drawtexture permanently?

I'm trying to get an image to show in Unity based on a certain criteria. I would like the position of the image to be randomized every time on play. However since GUI.DrawTexture shows the image for ...
-1
votes
1answer
107 views

How to add nice effects to my menu in Unity

I have a simple menu but I would like to spice it up with some of what I thought would be simple effects. I have 4 buttons that are just rectangle with some GUIText centered on the button and when the ...
1
vote
2answers
120 views

Unity - Mecanim & Rigidbody on Third Person Controller - Gravity bug?

I'm working on a third person controller which uses physX to interact with the other objects (using the Rigidbody component) and Mecanim to animate the character. All the animations used are baked to ...
4
votes
2answers
331 views

Unity - SetLookAtPosition() - Body Jittering?

I'm working on a third person controller and I'm trying to make character look at the same point as the camera. The problem is that the character jitters all the time the SetLookAtPosition() starts ...
4
votes
2answers
85 views

Problem with texture's quality in Unity

. After setting a texture to GameObject, it looks bad. Some pixels can be seen and colors are distorted. The image itself is in good quality but after importing it to Unity, it looks ugly. ...
0
votes
0answers
40 views

Sporadic collision detection between prefab and target?

I'm trying to get a enemy prefab to track a static target. The "enemy" is spawned into the playing area and using A* Pathfinding, tracks down the target by name. The prefab is destroyed upon collision ...
-2
votes
1answer
195 views

How to make healthbar decrease in unity [duplicate]

I want to build a health bar which show's the energy of the player.I have two buttons "PLAY" and "IDLE" to show the animation.when I click on the "PLAY" button the character start running along with ...
0
votes
2answers
69 views

Play animation when click on each player with in maincamera unity3d

I have 3 gameobjects player1, player2, player3, and attached script "playerscript" in to these game objects. In the main camera i have added another script called" testscript". When i click on a ...
1
vote
1answer
83 views

Why does my object instantiation work, but return null? [closed]

For some reason, the LogError runs: Player clone = Instantiate(player, this.transform.position, Quaternion.identity) as Player; if(!clone) { Debug.LogError("WTF"); } else { Debug.Log("WE ...
1
vote
2answers
111 views

Why does my ship look like it's going backwards instead of fowards? [closed]

I'm making an Asteroids-clone based on this tutorial. I'm stuck on the 5th part of the tutorial. For some reason my ship is going backwards instead of forward or it looks like its going forward, but ...
5
votes
2answers
177 views

Road network geometry in Unity: one big mesh or a bunch of smaller meshes?

I'm in the beginning stages of building a road system in Unity. It'll be your basic SimCity style road construction, with building and destroying roads done on the fly at runtime. When doing thing, ...
-2
votes
1answer
132 views

Energy Bar in Unity [closed]

I want to display a debug message when the progress bar is loaded fully and I have a button "refresh", when I click this it should reload the progress bar. Here is the code I have tried: var ...
5
votes
3answers
1k views

How can I build a game in Unity with minimum/no use of the visual editor?

I'd like to write a game completely in C#. In my search for an engine, I found Unity3D, but all the tutorials and documentation are speaking about a visual editor and the Unity IDE in which you click ...
2
votes
1answer
103 views

How can I ensure character weapon is also included in collision detection?

I have two models, my player character and her weapon. Each can be controlled independently (that is, I allow the player to aim the weapon). The object hierarchy is: Character (with ...
0
votes
0answers
85 views

How to pass a custom array of data to a shader

I want to know how to pass an array of data (it will be an encoded map, actually) to the fragment shader so I can query it as an array. AFAIK this is sadly not implemented in unity, so I'm looking ...
1
vote
2answers
355 views

How to make progress bar adapt to various aspect ratios in Unity3d

Can anyone help me with this problem: I want to make a time progress bar in my game. I have two textures: progressBarFrame and progressBar. Currently I'm doing the following: void OnGui() { ...
1
vote
1answer
83 views

Is Physics a prerequisite to learn Unity3D

I have got a basic knowledge about the Unity 3D platform but I coding in Unity has not been that easy for me. For the simple reason I can see is, I cannot understand which function to use for what ...
1
vote
1answer
49 views

Unity, shader, vertexID

I'm writing a shader and I just wanna ask if it's possible to get the ID of the vertex that is currently being manipulated. I read something about gl_vertexID, but I couldn't find out if that is ...
1
vote
1answer
56 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 ...
1
vote
2answers
205 views

How can I keep chase camera behind player when player rotates?

I have implemented a follow camera in Unity 3D. However, if the player object rotates, the camera does not rotate with it. To fix this I used RotateAround as follows: playerRotation = ...
2
votes
2answers
99 views

How do I get rid of this coloured border on my sprite?

I'm working on a 2D game in Unity. My triangle sprites display in-game with a line along one of the transparent sides: Larger view here. You might need to zoom somewhat. It's quite obvious on the ...
0
votes
2answers
73 views

Why does the text of my label objects overlap?

I am having a problem with labels in my GUI: I have looked for solutions online but not found something solid enough to fix this problem. Has anyone ever come across this? Here is my GUI function. ...
0
votes
1answer
87 views

Simultaneously translating and rotating sprite in Unity

I have a 2D object (a PNG file I dragged onto the screen) which is a circle I would like to move left and right when the correct side of the screen is touched and have it rotate in the respective ...
4
votes
1answer
58 views

Can you change Unity's default script template for a single project?

Can you change Unity's default script template for a single project? Here it's explained how to do that globally and it's fine, I wonder if you can do it on a per-project basis. I mean, I'd bet you ...
1
vote
0answers
145 views

Send Message: Object Not Found

I am trying to call a method within a Unity app from an Android activity by using UnityPlayer.UnitySendMessage. I am getting the error "SendMessage: (ObjectName) not found!". I've confirmed the ...
0
votes
0answers
24 views

Is there a way to make Unity 4.3 Sprite packer keep caching even after restart unity?

It's bother me a lot. It has to pack every time I open unity. It took sometimes until it finish. If I drag new image into project and do not specify any packing tag, it still repack. I know there's a ...
-2
votes
1answer
218 views

Identify mouse click unity3d [closed]

I have a 3 fbx models. I want to have each model do something when selected. But I'm not sure how to get them selected. I have managed to drag the 3 models into the scene, but from here on, I am ...
-1
votes
2answers
128 views

How to stop a object with progress bar so it can start instantly in unity [closed]

I have created a gameobject(cube) and written code to move,mean while the processbar get loading.when the processbar is loaded fully then the object should stop moving.Can anybody please help me ...
0
votes
1answer
69 views

Avoidance Steering Behavior acting inappropriately

I've been trying to implement this steering behavior in Unity: Understanding Steering Behaviors: Collision Avoidance However, I'm getting strange results. Here's the code for the script, feel free to ...
0
votes
2answers
124 views

Deal Damage to Player

I have to make a simple "avalanche" game to show I know how to use the physics and creating terrain. But I actually wanted to go a little above and beyond and actually give the player health so there ...
0
votes
0answers
38 views

How to replace reference to an object by content ID in binary serialization?

So here is the thing, the project has lots of logical objects, fed by data objects, data comes from serialization of yaml assets, containing model properties, like how fast a troll walks and such, ...