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
vote
1answer
24 views

Problem finding correct value for Yaw

I use an Arduino and a 9dof sensor ( gyroscope, accelerometer and magnetometer ) and i'm trying to use the pitch, roll and yaw that the sensor gives me to rotate an object in unity. I managed to ...
1
vote
0answers
26 views

How to generate mesh at runtime using raycast points?

I'm trying to make a clone of the trail/line renderer with the difference that everything is perfectly flat, i.e. the faces are not designed to face the camera. I'm using two raycasts to get the ...
0
votes
1answer
43 views

Code vs. Configuration in Unity [closed]

I know a thing or two about Unity at this point, but I've still lots of subjective, best practice questions, Such as: How do you decide what values are obtained via Start/Awake initialization, and ...
0
votes
2answers
110 views

Bullets doesn't do any damage

I have a melee enemy tagged as enemy. enemy has two coliders: a capsule(physics) and a sphere(for attacking player in radius and istrigger) and a particlesystem, enemy has enemyhealth script attached. ...
0
votes
2answers
74 views

How to access a variable from another C# script in Unity

I am working on a simple game project, and have a problem. The problem is accessing the variable from one script to another. For example :- I have 2 Scenes (Game Scene and Game Over Scene), Game ...
2
votes
1answer
58 views

Looking for a clever way to differentiate objects [closed]

I have a lot of cubes in my game (2d squares) and I decided to add some skins to them. However the colors that they have don't really make them look appealing. For example, I have this sprite: ...
1
vote
0answers
20 views

Collision destroy a cube when player collides [closed]

Unity- I have a mesh named and tagged as player I want that when it touches a Cube it should get destroyed C# script I need ....ty
1
vote
1answer
118 views

Unity UI Text Font Size changes with the screen resolution Problem

I am working on a project and now I have a problem . The problem is the font size. The font size is OK inside the Unity but it is really small when I play the game on a real Android device . My ...
1
vote
1answer
56 views

Unity 5.2 default 3rd person controller makes character fly upwards when moving forward

I'm new to Unity and already dealing with a problem.. using the default third person controller script I am trying to move and animate player. But I have a problem that as I try to move the character ...
-3
votes
0answers
65 views

Unity 2D tiled game, big map

I am developing a 2D game in Unity. The size of the map is: 11264 x 3072 which I have divided into 32x32 tiles ( 112 rows , 400 columns ) What Is the optimal way to draw/handle collision in ...
4
votes
2answers
113 views

Unity 3D C# - Shifting beetween worlds?

Let's say I want to replicate Planeshifting from Legacy of Kain: Soul Reaver in Unity. There are 2 realms: Spectral realm and Material realm. The Spectral realm is based on the Material realm, only ...
4
votes
1answer
57 views

save a particular area of the scene as screenshot in unity

I need to save a particular part of the scene as screenshot. I have done a sample to show the particular part of the scene. When I click on the rectangular area the selected area will being shown ...
1
vote
1answer
90 views

How can I locate GameObjects near the player in Unity?

I'm trying to figure out how I can find GameObjects that are close to the player so that I can delete them with Destroy(). I know how to use Destroy() but I can't figure out how to get a reference to ...
1
vote
2answers
54 views

Can Unity4 and Unity5 projects coexist in the same computer?

I've Unity5 installed (free edition). When I started with Unity3D I did with 5 and never had the 4 before. A friend has passed me legacy code of a 90% complete game he used to do with Unity4 as he no ...
1
vote
2answers
64 views

Detecting first or second Mouse Button Release?

I want to know how to detect if the user has released the mouse button the first time, or the times after that: Pseudo-Code: if *first* (Input.GetMouseButtonUp(0)) { do something } ...
0
votes
1answer
72 views

Health Bar is always 100% full

I have this GUI to graphically display a variable similar to the health in a game. The variable 'test' goes up and down during gameplay. To show this I have the following onGUI (): public GUISkin ...
0
votes
1answer
29 views

Hang script on the button in unity [closed]

When you click on a hand should trigger the script. I do not understand how this script to the button. Here's a script, even though he can not correct: using UnityEngine; using System.Collections; ...
0
votes
0answers
15 views

Buttons duplicated on game scene

I have this set of buttons in a monobehaviour class: public GUISkin btnskin; public Texture2D emptyTex; public Texture2D fullTex; public Vector2 pos = new Vector2(20,40); public Vector2 size = new ...
0
votes
0answers
37 views

Face Detection in Vuforia Unity Android

I am working on face detection in unity.I have tried out a face tracking sample from the below link.It worked fine https://github.com/marcteys/unityFaceTracking The problem is that,when I runned the ...
0
votes
1answer
39 views

Use constant force to hold something in position

This may actually be more of a Physics.SE question but since im doing this in Unity I figured I'd ask here. I am playing around with the Constant Force component and have a sphere constrained with a ...
3
votes
1answer
92 views

Unity - How to get UI text to follow an object?

I'm a relative beginner trying to learn Unity, and I'm trying to do something that I thought would be relatively simple: Have a piece of text hover over an object, following it if it moves around the ...
0
votes
2answers
38 views

Should I use Coroutines to change variables in inspector smoothly?

I want to change the aperture of the depth of field in the camera smoothly by using Mathf.SmoothDamp and a Coroutine, however, since I'm new to game development, I don't know if this is the right way ...
0
votes
0answers
37 views

Unity Player Smooth Left - Right Movement

I am learning Unity 3d . Now I want to move the player object (The Ball) , Left and right by Left Arrow and Right Arrow key . I want smooth movement when the player goes left , but I don't know how to ...
1
vote
0answers
34 views

Mirror problems after building game in unity

Hi I am facing a weird problem in unity when I build a particular scene. Here is the screenshot of how the mirror looks when I play the game from inside the unity editor: And here is how it looks ...
0
votes
0answers
45 views

Unity - _LightMatrix0 and Directional Light

I am trying to access the _LightMatrix0 in a forward base pass to calculate some light point of view coordinate but it seems that the _LightMatrix0 is empty with directional light. Any idea how can I ...
2
votes
1answer
60 views

How can I make a ball glow and cast light?

I want to make my ball glow and cast light on other objects in the scene. The scene is generated at run time so I believe baking is out of the question. Emission materials work only when the object ...
-1
votes
1answer
68 views

Sprite disappears on android

I am programming a game in 2D for android and pc/mac. The sprite is the same and it's visible on the pc/mac. But once I use android and move the sprite, it disappears. The code is this: what could be ...
-3
votes
2answers
93 views

Buy or make assets [closed]

As an indie developer, I don't know if I should make my own models or buy them from the asset store (unity engine). I do know basic modeling in Blender, but I also have spare money that I can use to ...
0
votes
0answers
41 views

Rolling Dice (Rag doll?) Unity 3D

I am creating a mobile application right now. I have 2 3D models which are dice, i want to be able to just swipe across the scene and move the dice, like a rag doll. But i am confused on how to ...
0
votes
0answers
41 views

transform.Find() doesn't find the specified object

I am learning Unity and C# and I've hit a wall trying to use the transform.Find() function. I am following Brackeys' tutorial for 2D platformers (https://youtu.be/m-J5sCRipA0?t=10m53s) and using the ...
13
votes
3answers
2k views

What's the difference between UnityEngine.Random and System.Random?

What is the different between this int randomNumber = UnityEngine.Random.Range(0, 10); and this private System.Random _rnd = new System.Random(); // other code int randomNumber = _rnd.Next(0, ...
0
votes
1answer
279 views

Unity WebGL not loading on chrome

I've made a simple game but when I tried to load this on chrome its not loading. I am building for WebGL (HTML 5). I am getting these errors when the page loads. Unity version - 5.3.1f1 Chrome ...
0
votes
0answers
38 views

Unity: Bypass Ctrl+S in a custom Editor Window

Is there a way to bypass Ctrl + S for Windows or ⌘ + S for Apple default behaviour (save scene) in a custom editor window?
0
votes
1answer
59 views

Click event doesn't trigger when clicking

I've made some buttons on my screen to navigate to other scenes of my Unity project but the Click(string command) method doesn't trigger. I've placed a breakpoint on the bold line in code below, but ...
0
votes
1answer
58 views

Shader change alpha depending on light

I use Unity, and I need a shader a bit special. Unfortunatly my skills about shaders are very limited and I need this shader quickly. So I want a shader to display a unlit texture on a plane, and ...
0
votes
0answers
27 views

How do i disable inherent scaling of bone joints in Unity?

Is there a way to disable inherent joint scaling in unity? In other words, stopping child joints from inheriting multiple scales from each bone higher on the hierarchy. Basically I want each joint to ...
0
votes
0answers
12 views

How to scale a bush mesh to 4 when it can only be scaled to 2 in the tree editor in unity

I had bought a unity asset (Yughes pines bushes v2) and the scale of the bushes is too small and so i put the scale to 4 and when i add the bush as a tree in the terrain editor it can only scale to ...
2
votes
2answers
640 views

Why doesn't my C#6 code compile in Unity?

Why can't Unity work with C# 6 code? It always gives me compiler errors. Here are some code examples: using static System.Convert; using static System.Environment; ...
0
votes
0answers
39 views

Singleplayer and multiplayer using same gameobjects in Unity?

There are a lot of topics about converting singleplayer to multiplayer games. But I could not find the accepted practice of keeping singleplayer gameplay available. Will this just work if I manually ...
0
votes
1answer
129 views

Continuous Jumping Cycle

The script makes a GameObject jump using realistic gravity and reach a specific target. The GameObject jumps relative to the target, thus adjusting its trajectory. It also works while the target point ...
0
votes
3answers
60 views

Show 3D elements on 2D background

I'll make a navigation menu in my game and had the good idee to this the enemies to start games or go to the gun store. The problem is when I look in game mode, the enemy named ZomBear in hierarchy ...
0
votes
1answer
87 views

Unity Singleton accross multiple scenes

I have a game where my code is designed to be on a single scene so I've implemented a singleton like that: public class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour { private static ...
0
votes
0answers
40 views

Difference between sprite and texture? [duplicate]

Can you please explain the difference between texture and sprite? When we zoom in a sprite, it appears blurry because it's basically an image. Is it the same for a texture? I read this comment on the ...
0
votes
1answer
18 views

Unity web player API?

Just curious about it. I only want to know that what graphics API does the Unity web player uses. Is that WEBGL? Or simply OPENGL? Or A custom one? Then how do the games get gpu acceleration?
0
votes
1answer
31 views

Sending message to all players in room from Photon server?

I need to send a message to all players in the room from a Photon server. Sending the message from a player would introduce too much latency so I need the server to collect data and distribute ...
1
vote
1answer
56 views

How do I snap the Unity camera to a 2D, tile-based map?

I have a 2D, tile-based map. I want to be able to control the number of visible tiles on the screen vertically and horizontally, regardless of resolution. I want the player to be able to move the ...
0
votes
1answer
36 views

Why does transform.forward appear to be void?

I have the following line of code from a project I'm working on: this.transform.position += (keyMapping.Value * this.movementSpeed).Scale(this.transform.forward); At a first glance, this line of ...
1
vote
1answer
48 views

Making a Fall Trigger Game Over

I have been struggling with this fairly basic issue: To make a game over menu appear upon death. I am making a 3D game in Unity, where you, the player, must control a sphere with the basic controls: ...
0
votes
0answers
22 views

Only one side of the object reflects light while in the shadow

in my scene I have a plane as a floor and a plane as a building next to it, my directional light is rotated to make the building cast shadow on the road. I placed a few cubes on the road, the ...
0
votes
2answers
41 views

Positioning 2D (non-UI system) game objects

As an old Flash dev I'm slightly confused about how you position game objects on the screen in Unity since game objects have no width or height (only a scale). Let's say I have a container gameobject ...