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)

4
votes
0answers
77 views

AI using character controller makes unwanted change to it's y position

The enemy parent object does not have any colliders except for the character controller. It starts out with y = .57 and immediately jumps to y=1.6355 because of my call to CharacterController.Move(.) ...
4
votes
0answers
86 views

Is there a way to determine Android physical screen size?

We're currently porting our games to Android, and would like to be able to release a universal build for tablets and phones. Is there a way to determine the actual screen size or DPI in order to ...
3
votes
0answers
20 views

How can non-CG shader code in Unity be included?

In Unity shaders, #include, #define, and other preprocessor commands seem to not be able to be used outside the CGPROGRAM section of the shader. Since these are required for compiling multiple shader ...
3
votes
0answers
59 views

Unusual black squares in transparency effect after wake from sleep

I've encountered unusual black squares in semi transparent textures for a while now, usually in processes that were resumed after the computer woke from sleep. For example I've seen the effect in the ...
3
votes
0answers
97 views

Unity - reconstruct position from depth

I am using Unity and I want to reconstruct position from depth and frustum corners in pixel shader. I am doing this: In my App, I calculate view-space corners of the far frustum plane and pass them ...
3
votes
0answers
132 views

Input.GetAxis(“Horizontal”) not updating

I'm having trouble with Unity's basic character controlling. After i implemented the crouching in the code below the Input.GetAxis("Horizontal") does not update (while the left control is pressed ...
3
votes
0answers
53 views

Unity 5 - custom lighting model

I have tried to use my own lighting model in surface shader in Unity. But there is a problem. If I init my own lighting via #pragma surface surf _SimpleSpecular Lighting_SimpleSpecular method is ...
2
votes
0answers
59 views

How to detect collisions with a material in Unity 5?

I've got a simple car game with 3 different surfaces: grass, tar and sand. I have a basic skid smoke system, but I want the color of the skid smoke to change depending on the surface, for example on ...
2
votes
0answers
51 views

Unity - Autoscroll when selecting buttons out of viewport

I have a ScrollView element, that contains many buttons. I want that when I select buttons (via arrow keys), the panel scrolls so that the selected button is contained within the viewport. How could ...
2
votes
0answers
110 views

Building an Octree for terrain generation

I've previously implemented marching cubes/tetrahedra to render an IsoSurface. It worked (YouTube), but the performance was dire as I never got around to implementing LoD (or even removing distant ...
2
votes
0answers
53 views

Unity: Create a custom editor for Vector2

I'm starting to dig into Unity's editor customization. What I'm looking for is a way to create custom line (or a point at least) which I could move around in SceneView and set a Vector2 value that ...
2
votes
0answers
45 views

Why are parts of this Unity scrollrect not being bound to the mask?

I'm setting up a system for people to load up extra levels. Since I don't know how many levels are going to be loaded I have a UI prefab that gets added to the main Level Load UI. However, the Text ...
2
votes
0answers
95 views

unity lag while moving a sprite

I'm trying to build a 2D game for android and after I finished developing the game I noticed that there was lag present when moving objects around. I tested it on a phone much more powerful than my ...
2
votes
0answers
50 views

using IK functions in MecAnim

The documentation on how to use IK functions clearly states that an Animator Controller with at least one animation for the character is required and then Layers pane, IK pass, etc... However, I ...
2
votes
0answers
53 views

Changing AnimationOverrideController “sometimes” fails - Unity 5.2.1

I have the following code, in a menu where you can chose the armor and weapon of a character: private List<string> armors = new List<string> { "armor1", "armor2", "armor2" }; private ...
2
votes
0answers
43 views

Improving Position Sync Bandwidth Usage in a Multiplayer Game

This is the class i use to sync position between clients in a multiplayer top-down 2D shooter game: [System.Serializable] public class MovementUpdateClass { public int MessageTime ...
2
votes
0answers
127 views

How To Create A Dynamic 2D Rope In Unity?

I'm trying to create a 2D rope in Unity that is fixed at one end and other is moving up and down to pick up objects just like a crane. I've tried adding a cube and making more instances of it, ...
2
votes
0answers
82 views

Ways to get around the limiting default terrain shaders in Unity

I am trying to use the Toon Rim Light shader for Unity however there are a few problems when trying to use any custom shaders for a terrain in Unity. The most well known is of course, that all ...
2
votes
0answers
40 views

Proper setup for Mecanim standing jump animation

I have a character standing jump animation with that the character at start prepares for the jump (flexing downwards) and then jumps up in the air and i'm wondering how to get it working properly with ...
2
votes
0answers
28 views

Restore IAP in Android using Prime 31

can someone please guide me how to restore purchases in android using prime 31. What my basic understating is to get the list skus which player has purchased after he logs in with his account and ...
2
votes
0answers
122 views

In Unity, how do I make a 3D flight arc preview?

I'm stuck on how to make a preview trajectory for a projectile appear when holding a button. The trajectory should start at a certain position on the scene and end wherever the player points their ...
2
votes
0answers
37 views

How would I add a sound variable to my code?

I am writing some code in JavaScript for a ray cast shooting program. I have all the variables I need except for sound, and I'm not too sure on how to add that variable into my code. I would really ...
2
votes
0answers
87 views

smoothly recenter view over time

I'm currently using the Google Cardboard SDK for Unity to build a fighter pilot simulator. What I'm currently trying to do is recenter the view(CardboardHead) smoothly over time when the user looks ...
2
votes
0answers
66 views

Rotate perspective camera to align screen width to procedural object's width (Unity, C#)

I give up. After much trying and searching, I have to say I was unable to achieve the following task, for which I must call for your wise advice. In my current Unity 5 application (using C#), there ...
2
votes
0answers
153 views

Creating Scenes Programmatically From A Deployed Build in Unity

This is somewhat of an extension to this question: http://answers.unity3d.com/questions/513801/programatically-creating-entire-unity-games.html I have a client who would like to create an entire game ...
2
votes
0answers
160 views

How do I get the depth data of objects closer than 800mm?

I'm trying to scan the layout of blocks on a table. My Kinect can be at most 1m away from the surface and I need to stack those blocks higher than 20 cm. I'm using Zigfu. Using the kinect 1 I have to ...
2
votes
0answers
383 views

Find References In Scene of scriptable object unity asset shows incorrect results

I'm trying to work out why my game is loading a large sprite atlas that I don't think it should be. The snapshot view of the profiler shows that the atlas is loaded. The references pane shows that ...
2
votes
0answers
466 views

How do I check user's unlocked achievement and leaderboard scores via GPG plugin

I need to load user's achievement and their scores from leaderboard in my game. But the Social.LoadScore() and Social.LoadAchievements() both returns a 0 size array in callback. When I checked the ...
2
votes
0answers
1k views

In Unity on Android, how can I rotate an object with the accelerometer?

I'm making a game where you control a platform with balls falling on it, and you have to balance the balls and prevent them from falling off. I'm currently using a mouse to control it with this code: ...
2
votes
0answers
554 views

How can I combine my scrolling effect with the vertex lit shader?

I want my shader to work in both Forward and VertexLit rendering modes. I'd written a texture scrolling shader, but I also want to consider lighting which is produced by Vertex lit shader. I can't add ...
2
votes
0answers
523 views

Access Android Camera.Parameters from Unity

I would like to access the android defined class Camera.Parameters.getHorizontalViewAngle() from a Unity3D c# script but my java skills are limited. Can anybody offer any help? I have this code: ...
2
votes
0answers
429 views

Call Unity3D coroutines from a scripting language

I created a simple scripting language to use on a Unity3D game. My parser generates an AST with nodes for every type of operation, and to run the script all I need to do is call Execute() on the root ...
2
votes
0answers
594 views

5.1 sound in Unity3d 3.5

I'm trying to implement 5.1 surround sound in my game. I've set Unity's AudioManager to a default of 5.1 surround and loaded in a 6 channel audio clip that should play a sound in each of the different ...
1
vote
0answers
8 views

How to add (not blend) non-looped animation clip to looped animation with Mecanim?

I have a GameObject with Animator and looped animation clip. This animation changes X coordinate from 0 to 10 and back. I need to add another animation to the first one that increases GameObject's ...
1
vote
0answers
19 views

Jagged Edges Even With Anti Aliasing 8x Multi Sampling

I have an interior scene where I have imported a model for the apartment and many of the interior objects such as lamps, windows, etc. Unfortunately I have a lot of jagged edges on almost all the ...
1
vote
0answers
45 views

How to reproduce this triangle filling scanline effect using a shader?

I'm writing a renderer for an old DOS game were 3D polygons were rendered in software. I'd like to simulate, using a shader, the following material/effect, used for filling a triangle : The fist ...
1
vote
0answers
25 views

How to receive broadcast message in Unity?

I am trying to get the broadcasted message in overridden method of NetworkDiscovery.OnReceivedBroadcast(). For that what I had done is below: I create class which implements NetworkDiscovery where I ...
1
vote
0answers
24 views

Avoiding audio transcoding in Unity?

I'm working on a project where I only have access to MP3s versions of audio tracks I'd like to use. Unity is trying to be helpful and recompressing everything as Vorbis, which is not ideal due to ...
1
vote
0answers
13 views

Unity: onEditEnd and onSubmit only firing from Return key

I have an InputField in my UI, but currently I can only submit its contents via the Return key. I tried mapping other buttons to the Submit action (e.g. the tab key on keyboard and the X button on my ...
1
vote
0answers
34 views

Unexpected behaviour after adding animator and Unity editor crash

I have realy strange problem which accured after adding animator(I suppose) to prefab Object. Situations looks like follow: I had object which have only sprite renderer, collider2D and script ...
1
vote
0answers
19 views

Unity keyboard GUI navigation priority

I noticed something strange while playing with my menu on keyboard. I have four items arranged in a square (i.e. the top-left item should be able to navigate to the top-right and the bottom-left). If ...
1
vote
0answers
18 views

Real-Time Speech & Verbal Communication with a Mecanim Character

What would be the simplest method of integrating real-time verbal communication within a mecanim character that is already being used in a Unity app/project? Something like an SDK or toolkit? I have ...
1
vote
0answers
52 views

Problem in power up generation

I am trying to instantiate an obstacles, Currency and Power up in the game. i am using same script to instantiate all. obstacles and currency are working perfectly but power ups is not generating in a ...
1
vote
0answers
29 views

“following” Object not Interacting with the game world correctly

So I finally have my object detecting the distance between itself and the player. If within range, the following enemy will chase the player down and touch it. (This will kill the player) However, ...
1
vote
0answers
87 views

Procedural Islands Voronoi Pattern

I'm trying to keep this as simple as possible, as I've found out the last few days this is a very difficult topic. I'd like to generate multiple flat islands, formed by a voronoi diagram. I've ...
1
vote
0answers
45 views

Unity 5 Google Cardboard VR SDK Frame Rate

I am running the Google Cardboard's official demo which doesn't really have much things on the scene (https://developers.google.com/cardboard/unity/download) on my Personal Unity 5 on my Nexus 5. The ...
1
vote
0answers
34 views

UNet send message by Client.Send error

I'm try to implement client-server communication base on UNET. The problem i got now is send custom message to server, but the Client.Send always show error without my understanding. So what i'm ...
1
vote
0answers
35 views

How to find or compute or look for overall/max RPM by simply checking for rotation?

I find it hard to determine the wheel RPM since I'm only making a simple 2D game of rotating object via Z-axis. I wanna try this solution but I got no change since I'm trying to find the RPM from a ...
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 ...
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 ...