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
votes
1answer
21 views

Sound plays several times upon collision

Upon collision, my sound effect plays several times. How can I fix this? public Sprite charAlive, charDead; public AudioClip popAudio; void OnCollisionEnter2D (Collision2D col ){ if ...
0
votes
1answer
36 views

Mecanim animation with displacement and physics (isKinematic)

I have my game 3D wolf models from animator with displacement i.e wolf transform with animation (not in-place). I have added rigid body on models. I am facing following issues while executing them in ...
0
votes
0answers
24 views

Resize gameObject when it has extended a restricted area

So here i have an image will provide a better understanding of my problem. So currently i have some white blocks and within the white blocks i have some cyan bordered boxes. So the current problem i ...
0
votes
1answer
58 views

Marching cubes leaving holes in the mesh

Hi I'm trying to reproduce GPU Gems 3 chapter 1 (Generating Complex Procedural Terrains Using the GPU) and so far I managed the basics... Now I'm betting some strange output. I started with the ...
-1
votes
4answers
116 views

Scripting vs Programming [closed]

How does using Scripting and calling functions of scripting API differ from programming using C++ in UDK or Unity?in scripting we use the scripting API to interact with the engine and use functions ...
0
votes
1answer
36 views

NGUI Texture Background Font of Sprite

I am new to Game Development and using NGUI plugin free version. There are few sprite images in my game. I made them prefab and instantiated at runtime. then I created NGUI Texture and Made it ...
0
votes
0answers
15 views

iTween.LookTo works only when the boolean gets changed

im trying to rotate an object when the player gets too close to it but it only rotates when the player leaves leaves the range for 0.5 seconds or less. It does the same if i use ontriggerenter and ...
0
votes
0answers
51 views

Random Object in Array

I am using Unity3d. I am stuck in my game. I Couldn't find the solution yet. I have created 8 different types of objects, stored in array, . i displayed them on the scene randomly in grid pattern. ...
0
votes
0answers
50 views

Load character instead of load level

I have some trouble finding out how I can load my character at the start of the level, instead of resetting the whole thing. The game mechanics are quite straight forward; don't touch the walls. If ...
0
votes
1answer
20 views

How can I Separate model parts when I click on it

Here I am using a heart model, in dis model I want to identify each part .Under the model Iam having 3 part(Sub1,Sub2,sub3)When I click on the each part how to separate or differentiate it by using ...
0
votes
1answer
30 views

Scaling a UI bar for progress in Unity

I have created a progress bar inside Unity for one of my energy systems. The bar progression works fine. Its just a plane pivoted on one of the faces so scaling it in x axis makes it progress further ...
2
votes
4answers
115 views

.fnt font file offset issues in Unity

I want to display 2D text in Unity using bitmap fonts (.fnt files). There are some solutions out there, but I'm writing my own. Each character is a game object with a SpriteRenderer. It works. ...
0
votes
0answers
17 views

Does Unity's “Compression quality” affect ETC2 compression?

In Unity I am using "Advanced" texture options on Android with ETC2 8-bit compression. There is an option for "Compression quality" as described here: ...
0
votes
2answers
100 views

How can I optimize the size of my .apk?

I noticed that the Flappy Bird .apk is only around 900 KB. I'd like to know how I can achieve a similar optimization in .apk file size for my own games, which use Unity. A small single-scene game ...
1
vote
2answers
111 views

How do I choose an optimal texture size for a mobile Unity game?

I am developing a 2D game with Unity2D for Android, iOS, WebPlayer and maybe for desktop computers. I think the working resolution of my game is 1280*800. How do I choose the optimal size of ...
0
votes
1answer
51 views

Lookrotation of a gameObject in just one axis

So I am trying to orient a gameObject ( house in the picture below) which is nothing but a plane and has a 2d texture on it as you see below. The whole game is made on a hex sphere. I am using ...
0
votes
0answers
16 views

Integrate MoPub native ads in unity

I want to add MoPub native ads in one of my unity project.So,is there any way to achieve this.Cause I found that it works with web and Android or iOS native apps. Is there any way around to make it ...
0
votes
2answers
69 views

Touch sides of tablet, moves that direction

I am making a game where the player flies a balloon through a cavelike structure. I am having trouble making him fly correctly when I try it out on my android tablet, seeing as it requires ...
5
votes
2answers
227 views

Achieving 1 pixel outline around sprites which changes colour depending on the background?

Here's an example of what I mean: In this gif, when the character is on the dark background, his outline is almost black, whilst it retains more colour if the background he's on is the sky one. ...
0
votes
2answers
106 views

Accessing DualShock 4 motion sensor in Windows (ideally Unity)

I'm trying to use a DualShock 4's IMU as a motion controller in Unity, under Windows 7. So far I've tried: DS4Windows (1.5.11): reads motion sensor data, but does not expose them to Unity as axes ...
0
votes
0answers
43 views

Unity directional light for a day night cycle on a hex sphere

So I am trying to create a Day Night cycle on a sphere but it doesn't work the way I want it to. As the model is hex tiled, you see the edges of the hex tiles also lit up like below. I am using a ...
0
votes
2answers
73 views

Movement nudge instead of constant

I am making a small game where the player is constantly moving upwards, and I am having slight problems with the movement to the sides. The script located under works quite perfectly in itself, but my ...
2
votes
1answer
94 views

Get object length and width divided by two?

I have googled and found a script for the following task; Make the camera move to touched position. However, this script will jump to x and y positions on an object, while i would like for it to move ...
-1
votes
1answer
92 views

Unity 3D: Raycasting for gun hits

I am having trouble understanding raycast hits in Unity3D. I am trying to create an FPS game, so I have a gun, bullets and so on. My script for the bullets is: var Bullet : Transform; var Spawn ...
0
votes
1answer
56 views

Camera Touch Zoom and Pan with world - 2D

I am doing my first unity2d game and im in need of a little optimization for my camera. I have a camera which could pan and zoom with the speed i have defined. The problem with that is the speed i ...
0
votes
1answer
48 views

Raycast doesn't point on the right direction

The raycast line im rendering is acting weird, it doesn't point where I want it to. I want it to point from the yellow object to the selected one but it draws it at another position. Here is my ...
0
votes
1answer
37 views

Variable Variables in unity using JavaScript?

I'm working on a custom built save system for a project a friend an myself are working on. Currently all variables that are saved to file, are stored as static variables in a global variables script ...
-1
votes
2answers
61 views

Unity - Can't Shoot While Moving

Shooting does nothing while moving, but it works perfectly fine while standing still in my Unity project. As far as I can tell no one else has this problem. I just used the Character Controller first ...
0
votes
3answers
140 views

Do I need to learn any physics if I use a physics engine? [closed]

Complete novice out here. Of course I know basic physics like mass and inertia. I don't want to make an engine I just want to make a game and use a physics engine made by someone else. Do I need to ...
-2
votes
0answers
38 views

How can I securely send information about player completion from a Unity game?

I made a game with Unity. When a player finishes the game, a form will appear so they can fill in their name and telephone and send that information to me. I need that information to be sent from ...
0
votes
0answers
57 views

How to overlay texture materials on top of each other in Unity 2D tiled game

I'm learning how to do a 2D tile-based game. So far, I have followed this tutorial which seems like a good starting point. With his method of building the raw triangles and then applying the uvs, I ...
0
votes
0answers
64 views

How to determine velocity from force

I recently started a project with the intention to master the physics aspect of Unity. Although I have a good knowledge of Unity, I never had the opportunity to work on game that makes extensive use ...
0
votes
3answers
78 views

Calculating the bounding box of a game object based on its children

2D game with Unity. Have a parent game object, with several children objects scattered all over the scene. I want to calculate the bounding rectangle of the parent game object. Let the black dots be ...
0
votes
2answers
65 views

Scaling a GameObject for a progress bar representation

I am trying to implement a progress bar system for my game. I know that it could be done with Unity's OnGUI and scaling with width of the texture but I don't want it to be a GUI element because in my ...
0
votes
1answer
46 views

Set a component on root gameobject for working all the children

I have a enemy which has ragdoll. So it has a few child object and each child has own collider. I dont want to add script for every child for just OnCollisionEnter function. All of them will work ...
4
votes
1answer
214 views

Consume input events in Unity 4.6

How do I consume the input events in the new 4.6 unity gui system? If I click on a button for instance I don't want anything else non GUI related that might be listening for mouse input to react to ...
1
vote
2answers
86 views

Does Unity load the texture data of all the sprites in a sprite array property?

using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public Sprite[] mySprites; } From the editor, you can put sprites in the array property. I want to put ...
1
vote
0answers
24 views

How to detect which side of a collider has been hit in Unity? [duplicate]

I have seen this question asked many times and I even asked this question before but I didn't understand the answers(I am very new to Unity). So I am developing a game and so far I have a wall you can ...
-1
votes
2answers
66 views

Execute native ios code in unity

I want to execute native iOS code in unity. For this I have added two files in /plugins/ios. ViewController.h ViewController.m Code for each file represented as under. ViewController.h ...
0
votes
0answers
45 views

Breakout Clone: Ball isn't bouncing as expected

So I'm working on a Breakout Clone using Unity 2D Physics only, and I'm having some trouble with the bouncing effect. Every object in my Scene has a Bounciness of 1. First, this is the code of my ...
4
votes
3answers
249 views

How to generate a “loop room” in a platformer game (by Unity)?

I want to build a level with a room whose left edge is linked to right edge in a 2D platformer game in Unity. My goal is let all objects disappear in one side will appear in other side of the room. ...
0
votes
1answer
69 views

Building a unity game without textures? [closed]

For a school project I have to build a unity game. Since the focus is on programming and building the game and not on creating graphics (we are supposed to find free models/textures online) I'm trying ...
0
votes
1answer
118 views

How to lock aspect ratio when resizing game window in unity?

I want a scalable game window that when resized stays at 16:9 aspect ratio. The goal is for the user to be able grab the window on the right or bottom and resize it. The game should adjust the ...
3
votes
2answers
280 views

How to approach a coloring app?

I want to make a coloring app in unity. I don't need flood filling. THe player will select a color and click the shape to fill that color. The app will have designs as shown below: Here the problem ...
1
vote
0answers
49 views

Aligning a gameObject to position and normal of another gameObject inside Unity

So I am instantiating a GameObject (the one with cities and trees in the image below) and trying to align it to a hex tiles on a Sphere. So after I instantiate the gameObject, I ray-cast to get it ...
0
votes
1answer
37 views

Using RPC's for movement of an object across a network [closed]

I've been building upon http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php At the moment when I spawn a sphere on the server it spawns on the ...
0
votes
0answers
63 views

Unity How to stop a jump?

transform.Translate(Vector3(horizontal * speed * Time.deltaTime, vertical * speed * Time.deltaTime ,0)); Im new to unity and Im asking how to stop a jumping, cause if I turn on this script on char ...
0
votes
1answer
69 views

How to make an object that has no rigidbody2d component smoothly fall on the ground in Unty2d?

I have two character in my game: enemy and main character. Enemy can throw different objects into the main character. For this moment i am doing this action in such way: void FixedUpdate(){ if ...
0
votes
4answers
117 views

When would a mesh collider be better than primitive colliders

I have been reading through the Unity Manual and have come across some interesting information about mesh colliders and primitive colliders. It got me wondering if using many primitive colliders would ...
0
votes
1answer
93 views

Finding next AI move using MinMax algorithm for Checkers [duplicate]

I am currently working on a Checkers game using Unity ( human vs computer ) I am done with the base architecture of the game ie defining the rules, moves, jumps etc. I am currently stuck in ...