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
29 views

UNET Error handling

I am trying to handle errors received by a UNET (new Unity3D networking) client. The below code successfully connects to a server when it is present, but obviously gives a timeout error when there is ...
2
votes
3answers
33 views

Get OnMouseDown to work with a 2D Polygon Collider

I'm having a hell of time getting a 2D polygon collider to register a mouse click. I've attached images and code to show where I'm at. I cannot get the click to work. Ultimately, the thing I'm trying ...
2
votes
1answer
150 views

Creating Fog Of View in 2D game with lighting method

I'm creating 2D side scrolling game with Unity, and i want to add feature where the player come into a cave, then all going dark, the player turn on the flash light, so the player can see around ( ...
-2
votes
2answers
81 views

How to set a background image in Unity?

I am trying to create a game on Unity but I am still learning. I want to make a start menu, and I want to set a background image. Then, I will add "Play" or "Exit" buttons on top of this image. How ...
1
vote
2answers
74 views

How to check if grounded with rigidbody

Does anyone have a better way to make an object with a rigidbody check for ground and then jump, right now I wrote a script where a raycast is cast downwards and it checks for distance but then I ...
-2
votes
2answers
74 views

How to stop game but animation is running?

i want stop my game but the animation is runnig. how to make it ?? for Example : i call anim, i want when press the eScape , my game stop but animation is running. void Update() { ...
0
votes
1answer
42 views

Quaternion.Lerp not working properly in Unity3d

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please? ...
1
vote
1answer
91 views

How to change the transparency of an object in Unity c# scripting?

I have laser-object in my scene, which I want to be seen only when I press the 'E' button on the key board(just an example of a key). I have seen many ways to change the transparency , however, none ...
-1
votes
0answers
24 views

Can I use Unity 5 without payment? [duplicate]

I'm just a teen that wants to get into game development, and so can i use unity 5 and make a game? If I decide to publish my game on the app store or something at any point will i have to pay some ...
0
votes
0answers
20 views

Unity fill in Sprites/Animations at runtime for Mecanim & State machines

I'm creating a 2D wrestling game in Unity 5. There are going to be 10 or more characters with exactly same states like walking, running, idle, jumping etc and same sprite names. I'm not sure but It's ...
0
votes
0answers
49 views

In the Unity Editor, how do I find prefabs containing a specific component?

I want to find all prefabs in the project that contain a specific Component? I only need this in-editor; no need at runtime. If they are in added to the Scene, I can right-click and Find References ...
1
vote
3answers
71 views

Collision Detection/Response Issues in Unity

Sprite A: Box Collider 2D and Rigidbody 2D. Sprite B: Box Collider 2D. Both sprites have a Sprites/Default material with Pixel Snap enabled. The textures being used are set to Truecolor Format and ...
0
votes
2answers
64 views

What will happen with PlayerPrefs data after updating the app?

I'm using PlayerPrefs (Unity3D, on Android). If a user updates my application via the Google Play store, what happens to the data I've stored in PlayerPrefs?
0
votes
1answer
28 views

Instantiation of multiple objects with varying velocities

I am looking to multiple objects of the same prefab at the same time with varying velocities. public GameObject prefab; public float xDirection; public float yDirection; void Update () { ...
0
votes
3answers
61 views

2D Physics friction on a moving platform?

I have a few basic platforming mechanics going on in this scene. I have a prefab platform with an animation that loops back and forth between two different x positions, but does not begin looping ...
2
votes
1answer
45 views

Unity 3D - Rotate towards object with random offsets

Title is a little confusing, but let me explain: I want to make the enemies look at the player, and shoot at him, with random precision, meaning that one time the enemy will shoot a little bit to the ...
1
vote
1answer
65 views

Unity3d seamless level loading

I've read that application.loadLeveAdditiveAsync is a pro only feature. I'm looking for an asset that can do something similar. I would like to load assets based on the camera/player position. ...
0
votes
3answers
56 views

What is the alternative to Time.time for scrolling texture?

In my game, I'm using the standard SetTextureOffset method to smoothly scroll texture on background quad. However, on game over, instead of reloading the scene, I'm just reseting all values initial ...
3
votes
1answer
62 views

Vibration on Android

How to change duration of vibration on Android(Unity3D)? For example: public void Jump() { if (grounded) { rb2d.velocity = new Vector2(rb2d.velocity.x, jumpPower); ...
0
votes
0answers
31 views

Unity - Meta pass and Precomputed Realtime GI

I am writing a shader in Unity and I would like to use some special values for the precomputed realtime GI. I am using a vertex fragment shader as it seems that it offers much more controls than a ...
0
votes
0answers
7 views

Error while running Unity WebGL build on MAMP localhost

I have built my game for WebGL platform and tried to run it on MAMP localhost. I am getting the following alert message in Google Chrome (Version 44.0.2403.125 (64-bit)) and in Safari (Version 8.0.3 ...
1
vote
1answer
52 views

Unity3d change texture on terrain at specific vector3 at runtime

I need the terrain texture to change at certain positions depending on where trees etc. are randomly positioned at runtime. I'm struggling to find any solid information about how to take a particular ...
2
votes
1answer
29 views

What framework do you reference for external dll's to work with Unity/Mono?

So I want to compile an extensions dll for a unity game because I feel I'll end up reusing these extensions in other games/projects too - and I want to learn about external dependencies with Unity. :) ...
0
votes
1answer
30 views

My GUI stopped working?

Okay I bought this asset online so I would like not to show the whole script. The problem is this asset stopped working when I updated from unity 5.0 to 5.1.2. The script is for a controller GUI ...
1
vote
2answers
64 views

Will reseting a scene instead of reloading it improve performance?

I made a 2D infinite runner. My game was approved for iOS and now pending release. However, on Android, performance is a nightmare. So I'm tweaking to optimize performance. As it stands now, there is ...
1
vote
2answers
84 views

How to know from which direction there is a collision with an object? In Unity C#

In the game, there is a ball, and moving objects that can hit it. I want the ball to move when an object hits it. But the ball should move to the right direction, the one which the collision was from. ...
0
votes
1answer
27 views

Cube bounces back with rigidbody and script in Unity

I have Unity 4.6.1 and I added a cube with a moving script and a rigidbody. The script is: #pragma strict var speed : float = 10.0; function Update () { // Is the user pressing left or right ...
0
votes
0answers
20 views

Unity forward render path creating pixel lines between meshes

I have a bit of a problem where my meshes are either unsmooth because I'm using deferred rendering path or they are smooth using forward rendering path but it creates this weird pixel line between the ...
0
votes
1answer
28 views

Stop player following cameras cameras direction

Okay I'm not going to go to much into it but this is what I need my script to do. The way I have my controller set up is that the camera looks to the side of the player a little bit. I use this for ...
-2
votes
1answer
39 views

Save the screenshot of the scene locally in unity

I have a unity project which contain a button in the scene. I have loaded a terrain also into the scene. When I run the project, the terrain and the button will be shown. When I click on the button, a ...
1
vote
3answers
73 views

How to load and unload objects at a certain radius from the player?

I am making a procedurally generated space exploration game in unity. I'm currently generating 5000 stars in a cube of a fixed size. Each star just gets a random 3d coordinate. What I would like to do ...
0
votes
1answer
42 views

Can I include 64-bit DLLs in a Unity 5 project?

I am building a C# DLL for inclusion in a Unity project. Due to some dependencies, this must be a 64-bit DLL. The last time I checked, DLLs for Unity had to be built with .NET Framework 3.5 (although ...
2
votes
0answers
49 views

How can the Server send a message to a single Client?

I'm trying to send an Rpc, or any sort of message, to a specific client instead of to them all. I'm completely at the loss trying to associate a NetworkConnection with its own authoritative spawned ...
0
votes
1answer
44 views

SerializeField vs GetComponent Efficiency

As far as I know, there are two built in ways to get an instance of a component in Unity. 1 - Serialize the field and drag in the component manually in the editor [SerializeField] private MyScript ...
0
votes
1answer
51 views

FPS horizontal smooth camera rotation

I have a problem, my camera is parented to the FPS Controller prefab, then there is a script I wrote for the rotation of the player horizontally by mouse movement, it all works but the rotation is ...
2
votes
4answers
341 views

Smooth Camera Follow

I am using a fixed static background. I have a gameobject(Current ref. image) which is moving with the help of waypoints. I have made camera to follow the Current. The camera is stuttering while ...
0
votes
2answers
124 views

Unity 5.1 Asset bundle for windows

I am working on the asset bundle method, i know how to use the asset bundle for untiy 4.x series but i am trying to do this in unity5. I heard in unity 5 is more compatibility to do. I searched in ...
1
vote
2answers
87 views

How do I refer to the object that called a function?

I have a large number of buttons instantiated from a prefab using a loop, as follows: public void LayoutButtons() { GameObject newCanvas = Instantiate (canvas) as GameObject; for ...
1
vote
2answers
123 views

Unity3D with C++ [duplicate]

So, my game is being developed in pure C++, with very limited dependencies (Mostly just pocoproject). The main goal here is portability, not performance. The code runs on multi-platform clients, as ...
1
vote
3answers
74 views

Move ball based on direction of force?

I'm trying to make a ball that will move in the direction I push it from, and later pull it to me based on where the player is standing. using UnityEngine; using System.Collections; public class ...
0
votes
1answer
33 views

Finding enemy object in player's forward direction within a range

I would like to know the way by which I can find enemy objects tagged with "player" in a forward direction within a range say 3 units from the player.
0
votes
0answers
23 views

Compiler error when building for Android after exporting Oculus assets

I have a Unity project which I'm planning to build both for PC and Android. The project is a VR game. For PC I'm using the Oculus SDK and for mobile I'm using ALPSVR SDK. I was working solely with ...
0
votes
1answer
38 views

Card/Tile Game, loops dont update element0 of playerHand properly

The Problem I am dealing from another class and into a player's Tray(A class with a List of Tiles and an array of bools to show that a slot in the tray is full). When dealing into the player's tray, ...
0
votes
1answer
53 views

Unity5x GetComponent<Animation>().Play(“sequence”.StopAll) not working

I'm working with Unity3D 5x using C#. I've attached collision detection to the character controller script that plays a "gothit" animation clip (using legacy animations). Here are the code snippets, ...
-1
votes
1answer
68 views

How can I can create a world that a player can easily get lost in? [closed]

I am a 3D environmental artist and I'm currently planning an independent passion game project of mine. I have the concept of crazy hallways that lead to the rooms that the player has already visited, ...
1
vote
0answers
28 views

Google Play Games Signs Out Automatically without Internet Unity

I am using this in my game to implement games saving and loading. I have also tried the basic sign in process by using the following start function :- { PlayGamesClientConfiguration config ...
1
vote
0answers
12 views

Is there a way to control the ordering and grouping of ShaderLab Blend command?

I'm writing a shader in Unity that responds to 3 lights: 1 directional and 2 point lights. The point lights are processed in the ForwardAdd pass (once per light). I need the ForwardAdd pass to blend ...
3
votes
2answers
59 views

How to manipulate the two variables that rotate the camera with Input.GetAxis(“Mouse X/Y”)?

A helpful fellow showed me the script for a free look camera mode that rotates with the mouse. The script is included at the bottom of the page. I want to have a system that right clicks once to ...
3
votes
1answer
62 views

Skydome and Ambient Intensity (Unity)

I've made a custom skydome in my game. For all my lights I have set them to not affect the skydome. The only thing affecting the skydome is the ambient light. For my game I have ambient intensity at ...
2
votes
1answer
39 views

Decelerate moving platform at targets

I'm trying to make a moving platform move at a constant speed and then when it is near the target start to slow down, I have trying to do this with Lerp, but I'm not satisfied with the results because ...