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

Why isn't OnTriggerExit working?

I have a price of code that looks like this: void OnTriggerExit() { Debug.Log("Object leaved trigger"); } But when I move an object that is colliding with the trigger by script it doesn't print to ...
1
vote
2answers
63 views

How to freeze rotation with a Rigidbody 2D? [closed]

So I am looking to freeze rotation in the Y axis on a Rigidbody 2D. I'm not sure how to set this in my code. This is what I have so far, can you point out my errors? public class PlayerMovement : ...
0
votes
1answer
68 views

Unity procedural TileMap generation without creating gameobject per tile

I've been searching all over the internet to find a efficient way to create procedural tilemap without creating a gameobject per each tile. There is none, or simply i couldn't find it, because i ...
-5
votes
1answer
64 views

Is it enough to read manuals? [closed]

I want to develop games with Blender and Unity. I don't see any good books out there and so I'm considering reading the manuals of both the software. Should reading the manuals be enough if you're ...
1
vote
2answers
423 views

Testing Unity 2D Physics

I am looking to push the 2D physics in Unity to the extent where when so much is going on that there becomes noticeable lag in a game. This is for testing purposes, so that when so much is going on ...
0
votes
1answer
55 views

Unity Transform.Position not returning expected position

So in my scene hierarchy, I have an object laid out like so; -Level1 --Level2 ---Level3 ----Level4 My script is attached to the Level1 object. When I try to find the transform.position of Level4 by ...
0
votes
1answer
37 views

Texture doesn't scale and repeat

I wrote the script for automatic repetition of texture background. To save it I typed Cmd+S. I dragged and dropped the script to Background in Hierarchy. When hit play button the texture doesn't scale ...
-1
votes
1answer
35 views

Serialization is not saving high score

I wanted to avoid using playerprefs because they are easy to edit. So, I went with Serialization. Here is my main class that does all the scorekeeping: public class scoreKeeper : MonoBehaviour { ...
1
vote
1answer
38 views

Is my collision-free location script working?

I've recently been learning C# and I wanted to take one of my 2D tutorials to Unity. I reached a step where I need to spawn my new sprite into a collision free location. I've followed direction - ...
0
votes
1answer
49 views

How can I increase the speed and frequency of a spawn?

I'm using the official Unity tutorial for the Space Shooter game, and I'm at the part where the ability to spawn a set amount of hazards in a wave at a certain delay is introduced. I want to make it ...
2
votes
1answer
321 views

How do I make the host work in UNet?

According to the "High Level API" documentation, unless I misread something, a Host "just" runs both as a Server and as a Client, so much that it would require no special support, i.e. it should run ...
1
vote
0answers
25 views

Is there a way to build asset bundle that exclude texture2d from an image?

In unity 4.x, I can archive this because I can select my resource type directly as Sprite variable before putting it into the bundle via BuildAssetBundle. However, in Unity 5.x, I need to put the name ...
-1
votes
1answer
50 views

Why is this unity camera moving in weird directions?

I have the following script public class CameraScript : MonoBehaviour { public bool AllowZoom; public float zoom; public float Speed; Transform board; void Start(){ ...
2
votes
0answers
56 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 ...
1
vote
1answer
11 views

Unity: Can't access repeatDelay from StandaloneInputModule?

I have a very specific problem. I'm trying to change the repeatDelay variable within my StandaloneInputModule, but it's not coming up as a variable. All of the other variables come up when I use ...
1
vote
2answers
254 views

What's the difference between Destroy() and SetActive(false)?

I read about both methods in Unity and wanted to ask about which was the best in efficiency : destroying the object or deactivating it. What is the performance difference?
2
votes
1answer
141 views

Why will my server not execute a command sent by the client in Unity 5.1?

I'm working on a very simple/basic client-server networking program, the basis of a future game I hope to create. Now the client program/project DOES successfully connect with the 'server ...
2
votes
1answer
45 views

Unity C# Object Scaling when parenting by script

How do I make it so an object doesn't scale with another object that I parented it with by script? If anyone knows how to get around this I would really appreciate it. This is the part of the script ...
0
votes
1answer
20 views

Resources.Load doesn't grab values of my child class

I have a parent class Unit, and child classes melee unit/ranged unit. The parent class holds uninitialized fields such as health, damage, etc. the child class sets the values of these fields in an ...
1
vote
0answers
22 views

Unity: Finding out where OnSelect comes from

The new UI EventSystem method OnSelect is called from a number of different sources. One is when the Selectable is selected by using the arrow keys to navigate. Another is when clicking on the ...
1
vote
1answer
166 views

How do I Sync data from client to server?

I'm trying to Sync data from the client to the server using the new Unity Networking, and I'm failing for some reason. I've set up a prefab with a NetworkIdentity component with the attribute Local ...
4
votes
1answer
114 views

Convert large range of numbers to a smaller scale

What is a good formula to use in order to relate two different scale distances to each other? For example, I have a camera that can have a minimum size of 2 and a maximum of 10. I would like the ...
1
vote
1answer
60 views

How to create gui image with script

So I've been fiddling around with the new UI system recently -- and one problem I have is adding images of my sprites to the ui. I know I can create a prefab of an image gameobject with the sprite ...
2
votes
1answer
32 views

GetButtonDown for Unity keyboard UI navigation?

By default, Unity's keyboard navigation for buttons seems to check for GetButton rather than GetButtonDown--if a menu has 5 items and I hold the down arrow, it'll scroll very quickly to the bottom. ...
2
votes
1answer
73 views

2D Camera sizing and movement

Apologies if this is a basic question, or been asked a 1,000 times in the past... I'm new to Unity, and having problems understanding some of the basics to do with 2D cameras (orthographic), and ...
1
vote
0answers
33 views

Unity: OnGUI streamlining

So like most games, I have inventory screens, equip screens, shop screens, and all that. I've previously been making each "screen" controlled by its own script (which is normal I think), and I draw ...
2
votes
1answer
42 views

Separate rotation transform from parent

I have a hierarchy like this Body - Head - Arms Currently this works fine in that the Body's transformation is reacting as it should. Being children, the Head and Arms match the Body's ...
1
vote
1answer
63 views

How to script enable VR in Unity 5.1

Unity 5.1 has integrated VR, its in the Build Player Settings as a checkbox. I want a startup scene that is not VR, then when the user starts it enables the VR camera. Can I do that?
0
votes
1answer
94 views

Objects spawned on clients only appear locally

I'm trying out the new Unity 5.1 networking for a Bomberman style game and i can't seem to get the bombs to instantiate on both the client and all those connected, what am i missing? The code below ...
1
vote
0answers
65 views

Pausing game with State machine and handling jumps

I am adding pause functionality to my upcoming racing game.The players can jump in it. Time.timeScale = 0 is obvious solution to pause game.I am avoiding this solution as users can do in app ...
0
votes
1answer
22 views

Isn't OnGUI and Event cyclical?

Here's what I don't understand about Events: the documentation says that Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events. For each event ...
1
vote
1answer
53 views

How to create a material that blends textures in Blender to Unity workflow

I'm new to Blender and Unity and trying to figure out the best way to create a material that will use either vertex colors or a texture map to interpolate between other textures on a single mesh. ...
0
votes
2answers
42 views

Tile map creation, problem with position of tiles

I am trying to create a basic tile map script to learn Unity and I am unable to understand why my tiles are spaced far apart and I can't seem to control their spacing. Moreover, there seems to be a ...
0
votes
1answer
38 views

Unity gravity not effecting everyone like it should

so My problem is a bit weird. I have a model that will not fall at the correct speed. She falls incredibly slowly. This is the only script attached to her, and I did the "Scale to large" test by ...
0
votes
1answer
104 views

Spawn scene object not found for 1

I'm getting this error with the new Unity Networking (5.1): Spawn scene object not found for 1 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate() This happens in the client, when it connects ...
1
vote
1answer
139 views

Making a 2D sprite move in a curved jump in Unity

Given a 2D Sprite (I'm using NGUI if it matters), what is the simplest way to move it to another position using a curve that resembles a jump? When I used cocos2d, there was an action called JumpTo ...
-4
votes
1answer
58 views

Unity How do you rotate an object with a rigidbody so it's facing the it is traveling [duplicate]

I would like to know how i can rotate an object with an rigidbody so it's facing the way it's traveling.
0
votes
1answer
51 views

Damping in Unity Shuriken Particle System

Is there no damping functionality in Unity Shuriken Particle? "Velocity Over Lifetime" is different from damping. I try to find it on particle system, but can't. Or is there any other way to apply ...
-2
votes
0answers
20 views

Where do I place my application ID for using Google Play Services in Unity?

I have searched the samples but I have not seen any declaration using the app ID rather than the Leaderboard ID (the Service I'm using). Thanks in advance.
1
vote
0answers
22 views

How to blend motions with Mecanim

I'm struggling with Mecanim. My concern is to blend straight/turning animations with strafe animation for a humanoid character. I downloaded a SampleAsset from unity and took Ethan character as ...
4
votes
3answers
145 views

Single Switch Script vs Multiple Scripts

Would it be better to have one script that switches or have multiple scripts with each with their own function? In example, Lets say I am making a powerup script. Option 1: Create a single powerup ...
1
vote
1answer
35 views

Unable to achieve two finger panning

I'm looking to achieve a two finger smooth pan system in my project. However, the code below does not work, any interaction with the screen doesn't change to position of the camera. I am unsure where ...
1
vote
1answer
60 views

Accessing the child sprites of a sprite sheet in unity?

I have a spritesheet set up with the individual sprite regions named in unity. I haven't been able to find out how to access these sprites by name?
0
votes
1answer
52 views

Making a zoom out/in space map in Unity

I'm new to unity, I was wondering how would one go into implementing a dynamic 2d space map. Let me give you an example what i mean. You see our solar system on the map, if you zoom out at a treshold ...
2
votes
1answer
55 views

Custom Editor for Map/Dictionary in Unity

I'm trying to build my own little ResourceManager in Unity that will allow me to tag resources (ranging from materials to prefabs) to a label in the editor, and then access them in game. The ...
1
vote
0answers
72 views

Using GrabPass for 2D water reflection?

I'm trying to achieve some neat 2d water reflection effect with Unity, something like this: What I've managed to accomplish so far: The problem is GrabPass captures the entire screen but I really ...
-3
votes
1answer
51 views

How to i create a Particle system in unity5? [closed]

how to i create Particle system in unity 5 like a fire, smoke and other types of particles by using unity 5.
1
vote
1answer
70 views

Smooth rotation Unity3d

I have an animation and I modified some rotations of some bones in the animation at a certain frame. What I want to do is how to make the animation in the next couple of frames interpolate smoothly so ...
1
vote
1answer
58 views

Unity5 imported models show no texture

I've got a problem with Unity materials. I'm a beginner- so I used Wings3d for creating 3d models. But there's a little Problem. Both objects on the picture below have the same material(a Standart ...
1
vote
1answer
54 views

Unity: LineRenderer always behind Sprite

So I'm not sure what I'm missing here -- I created a bullet gameobject with a linerenderer (no sprite renderer) -- and it always renders behind my other sprites, regardless of what I set the z ...