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)

0
votes
1answer
27 views

Select all components of certain type in the children Game Objects

I would like to set programatically the material on a Game Object. The problem is that it has several Child Objects, which many have their own sprite. I came up with this... foreach(Transform ...
0
votes
2answers
58 views

reuse texture between quad objects

This question is specific to unity: I want to spawn multiple blocks, each representing a letter. There will be more than one copy of an alphabet. I have a big texture which contains all the letters ...
3
votes
2answers
87 views

How to access the currently touched instance of the Prefab?

I have a prefab which is instantiated in the Scene and what I am trying to do is to disable with a touch or timeCounter but sometimes it disables all the instances of the prefab and sometimes 2 or 3 ...
-1
votes
1answer
42 views

Unity syntax highlighting with VSCode

I'm using VSCode, not VisualStudio for Unity scripting. VSCode has syntax highlighting for C#, which works fine, but all the Unity related stuff like Vector3 doesn't get any highlights. I know, that ...
10
votes
1answer
593 views

Unity - Order in Z layer for objects

Sorry if the title isn't exactly what my question is, I don't really know how to describe it. I have an image for my city floor and an image (same size) for all the walls or trees that the player is ...
0
votes
1answer
45 views

Unity - Hide GameObject that is behind UI

I have the following example: How can I prevent the part of the sprite that is highlighted in red and is behind the UI from being displayed on the camera, but having the background image still ...
-1
votes
2answers
41 views

What is the difference between getting a reference and creating a new instance of an object? [closed]

I asked a question a while ago and got an answer that I can either get a reference to the object or create a new one, like the below example: Example myExample = get some reference to the ...
0
votes
0answers
35 views

Unity3D - Android build has no Internet Access

I'm having trouble connecting to the internet in an Android build. I created a simple program that checks if there is an connection. Also I set in 'Edit > Project Settings > Player' the Internet ...
1
vote
2answers
46 views

Get world position of touch on objects

In my Unity3d game, I want to get the world position that was touched, when I touch a specific object, regardless of all objects that are in front of it. How would I do that, I only know ...
-2
votes
1answer
79 views

Terrain making in unity [closed]

I'm making a minecraft-like game, I'm trying to make a terrain made of cubes, but copying and pasting the same cube takes too much time and uses too much of my pc's RAM. So, any suggestions?
2
votes
3answers
84 views

Calculate average of arbitrary amount of quaternions (recursion)

Simply calculate the average for 2 Quaternions should work like follows right? : Quaternion.Lerp(rotationlist[0].transform.rotation, rotationlist[1].transform.rotation, 0.5f); And now I tried to ...
0
votes
1answer
40 views

Pixel Animation is tearing in Unity

I am working on a 2D game and I have created a simple sprite sheet. The sprite sheet represents a medkit. The size of the sprite sheet is 128x16 pixels with 8 different frames that animate the medkit ...
0
votes
1answer
45 views

How do I access variables using namespaces?

I've got a whole lot of scripts, none of them so far use namespaces. But as I get more and more scripts to deal with I thought it would be a wise idea to start using namespaces. I've never used them ...
0
votes
2answers
38 views

Unity 2D Following player on the x-axis only, at a constant speed

This following code does work, but I have one issue with it. Once the gameobject starts getting close to the player that it is chasing it slows down and does not continue going at a constant speed to ...
0
votes
0answers
21 views

Sounds in Unity game play to opposite speaker

I'm using Unity Game Engine. I have an AudioListener attached to my camera gameobject. Even though my earphones are in correctly, sounds that should be playing to my left ear play to my right, and ...
1
vote
1answer
29 views

Handle shared vertices in mesh deformation

I have a cube-sphere made from 6 planes. I am deforming each of the plane vertices using this code (C#): aPlane.transform.aPoint(vertices[i]).normalized * this.radius + (randomFloat)); This gives ...
0
votes
0answers
35 views

Using animation in Unity?

How can I simply implement this animation in Unity: codepen.io/epilande/pen/ZYMqNX I am ready to buy the PowerUI asset, if I have to.
0
votes
0answers
13 views

Distance fog smooth out plane's fade with respect to ground

I am looking for distance fog for my endless racing game. Unity's default fog system is too heavy for mobiles so for workaround I am trying to add large plane with transparncy..the problem occures ...
0
votes
0answers
19 views

Multiplayer Spawn not working

The error message I get is SpawnObject for Player(Clone) (UnityEngine.GameObject), NetworkServer is not active. Cannot spawn objects without an active server. I know that the server is ...
0
votes
2answers
37 views

Collider not working

I have a 2D object (without a parent) with a 2d box collider (dimensions are not small) added to it and set as trigger when I place it in the scene it works just fine however when I instantiate its ...
1
vote
2answers
29 views

Rotating a Sprite and Moving It along That Angle in Unity

first time posting here. What I want to do seems extremely simple, but I'm not familiar enough with Unity to be able to implement it. Also, I wasn't able to find an answer that exactly solved my ...
4
votes
1answer
274 views

Set a 'chance to spawn' for each GameObject in an array

I have an array of gameObjects in a spawner. I want to randomly spawn these gameObjects based on a weighted chance. I want to be able to manually set in the Inspector a percentage chance that an ...
1
vote
0answers
11 views

Unity: Built-In Shader Transformation Explanation Resource

I'm working on some of my first shaders and taking a look at the variables included by cginc I see this list of transformation matrices: I've watched some beginner talks and I understand what the ...
1
vote
0answers
15 views

Unity Trail for Eyes 2D

i want to make some kind of an Eye Tail effect for this charakter: I found the Unity Trail Renderer effect but the start of the Trial is perpendicular to the dragged/moved direction: Can i make ...
0
votes
0answers
16 views

Unify visual experience across different devices' screens

How would one approach the problem when your graphic assets (images, textures and so on) look different on different devices? For example, an artist made a set of graphic assets looking at his display ...
0
votes
0answers
14 views

How can I add a material to a property drawer?

I am trying to create a property drawer with the ability to select a material, but for there to also be other components, such as a min-max slider. I have successfully created the min-max slider ...
3
votes
2answers
64 views

Stopping 3D object in place

I am at 1.2 stage (moving the player) at Unity course "Roll-a-ball" and have question: I want to add feature that stops a player and sets his new position on 0, 0, 0. I can reset the position, but I ...
0
votes
0answers
34 views

Share Image on Android Application from Unity Game

I've captured screenshot in my game when player dies. I've following code to capture screen shot. RenderTexture rt = new RenderTexture (800, 600, 24); MainCamera.targetTexture = rt; ...
2
votes
1answer
32 views

How do I include XML files in an Android build?

I have a few XML files I want to include in a build of my game, and I want to have access to those XML files in Android. How to I store and load those XML files?
0
votes
0answers
25 views

How to compress an asset bundle and decompress it on iPad or iPhone

In have a prefab size of 2.4 mb, when I convert this into Unity Asset Bundle, the Asset Bundle is goes to 127.2 mb. How can I compress this into small size? My code is: public class ExportScene : ...
1
vote
3answers
55 views

Static variable not holding its value

I am creating a real time multiplayer game in Unity 3d. When a game ends I set a static boolean value called "waitingToEndGame" to true. In Update() it waits a few seconds before moving to a new scene ...
0
votes
1answer
26 views

how to manage loads and memory usage and process in unity

i wan to know level and scene management for memory and process management is handled by unity or not or developer has to handle these kind of works. for example think you want to know develop an ...
3
votes
1answer
44 views

place sprites in grid pattern within an area

I have been trying to do this for a few hours in unity now but cant get my head around it. basically i have 4 points(vector3) 1 each for the 4 corners topleft, topright, bottomleft, bottomright. now i ...
0
votes
0answers
31 views

How can I delete multiple scenes at a time from Unity's hierarchy panel?

I started using Unity this week and having some trouble with the interface. I can't figure out how to delete multiple scenes from the Hierarchy panel. I select them all and can't right-click "remove ...
0
votes
1answer
28 views

Unity 3D Move Object with RigidBody

I have added RigidBody component as well as Mesh collider to an object moved with keyboard. I know that it the object will go through another (with RigidBody and Mesh collider too) if I use transform ...
1
vote
1answer
50 views

Draw wireframe models for Gear VR app: Unity or Eclipse?

I want to create a 3D Android app for Gear VR that does/lets me do the following: Read an input file with a bunch of coordinates of points (including information about how they should be connected) ...
1
vote
2answers
35 views

Unity get more than 2 lines of log height

Unity does only display 2 lines in height for each log, at least with the default settings. I couldn't find a menu, where I could change this. I want to display a matrix, and I need to see the log ...
0
votes
1answer
36 views

Unity C#: Change speed when all Targets are destroyed

I have a game where a Gunner moves on a pre-set path towards a final destination. You play as a Magic Bullet that auto-fires from the Gunner's current position and can be controlled with WASD. When ...
0
votes
0answers
33 views

Unity websocketsharp is closing the connection directly

I got a working code, which I want to change a bit for better readability but afterwards my web socket is just closing instantly. First off, I got this code working : using UnityEngine; using ...
0
votes
1answer
19 views

how to bring movement and rotation vectors of object in the current scene in unity editor

sometimes in unity i need to zoom to fix the exact position and rotation of an object. but movement and rotation sign of the object always stays on object and i think its pivot of the object. How ...
0
votes
0answers
40 views

Dot product not working as expected

Recently I am learning dot product, While below code works from Unity's documentation, http://docs.unity3d.com/ScriptReference/Vector3.Dot.html public Transform other; void Update() { ...
0
votes
1answer
20 views

Rotate smoothly object to angle (Y axis) of the collided object

Well, let's say I have two planes, one which I am moving, and another one that I collide with, that has a different y rotation. I want to make that, once both planes collide, the plane the user ...
3
votes
1answer
78 views

How do I get data from a WWW object without freezing my game?

I am using Unity 3d to create a real time multiplayer game. I have a database set up that keeps track of player statistics and what in app purchases they have purchased. I have written a Database ...
1
vote
1answer
64 views

Unity2D Isometric layering

I'm developing an Isometric Game but I have problem apply the right layer for make, for example, a wall behind or in front of the Player depending on the Player position. I'm able of getting works in ...
1
vote
1answer
66 views

Reducing mobile build size

This is my second time making and game and I want to make sure that I fit under 50 mbs. So far my plan is to fit all the games artwork into two 2048x2048 sprite sheets. I tested a empty unity3d ...
1
vote
1answer
37 views

Unity simple solid color alpha shader

I searched for a shader, where I can set a solid color, which I can fade in or out like I want. There is not such a thing build in as far as I could see. Now I got this code, which works fine in case ...
-1
votes
0answers
20 views

Zoom only the particular object in unity

I am working on a sample to zoom the particular object when clicked on it.I have used the following code var zoom : int =15; var defaultFov : int=60; var smoothness : int=5; var isZoomed : ...
1
vote
0answers
30 views

Unity 5.3.4: Controlling multiple audio sources at once?

Is there a way to control the max distance of a group of audio sources at once? I want to implement all my sounds, then be able to play with some of the audiosource settings of all of them..
0
votes
0answers
15 views

Unity Lens Flare disappears at edge of screen?

I'm using a Lens Flare component to represent the sun in a 2D game. When the sun rotates onto or off of the screen, I noticed that the flare effect disappears. Basically, once the center of the sprite ...
0
votes
0answers
16 views

How can I make an expandable menu and assign names to buttons randomly from an external file using Unity?

I'd like to create a menu on the lower left side of the screen which will present some options (guns) to the player. The number of options should change based on how well a player is doing. In other ...