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

Put a coroutine on potentially infinite loop

I have several coroutines always running. I want to put these coroutines on hold as I set the game to pause mode. Consider the content of these coroutines as follows while (timeleft > 0) ...
3
votes
1answer
117 views

Why flip sprites instead of creating extra assets?

Why is the preferred method for changing the direction a character is looking in a 2D game a sprite flip? Why not just create the extra asset and show that one on screen?
0
votes
1answer
31 views

How do I interpret the differences between the “Time” and “Self” columns in Unity's profiler?

I'm not quite understanding how to read the results of the profiler: A method Pathfinding_NodeAdjuster.CheckSpecificArea() method is using up 94.7% of the BehaviorUpdate overall time, while taking ...
1
vote
2answers
109 views

Pausing the game

I've had a look around and kept finding about using Time.TimeScale = 0 to pause the game, although this is the normal way to do it, it is not exactly what im looking for. When my menu button is ...
1
vote
1answer
131 views

Ways to improve endless racing traffic

I am looking for ways to improve my traffic AI for endless racing game. Currently, I have hard coded situations where randomly cars will be spawned ahead of user bike depending on position of player. ...
1
vote
1answer
125 views

Unity 2D Diablo style movement

I've made a totally new scene for a 2D mobile game. I placed a sprite on the center of the screen and attached the following script onto it (this is basically a diablo-style click-to-move control ...
0
votes
2answers
100 views

How can I prevent 2D teleportation from teleporting through solid objects?

In my 2D game, the player is able to teleport to any place on the screen with the click of the mouse button. What I am trying to prevent is the ability to teleport across solid objects. If the point ...
1
vote
2answers
48 views

How do you freeze your cursor in Unity?

In a typical MMORPG, when I hold down the right click button and drag, the cursor disappears and stays in the same position. How does one do that?
-2
votes
2answers
70 views

How solve 400 Bad Request error in unity? [closed]

400 Bad Request UnityEngine.Debug:Log(Object) FBScript:DisplayUserName(IResult) (at Assets/Script/FBScript.cs:63) Facebook.Unity.c__Iterator1:MoveNext() (at ...
0
votes
1answer
57 views

Animation timeline organization for Unity 5

I create stuff for AssetStore and use 3ds max and Unity 5. Can someone tell me how I need to work with timeline? When I create animation for several objects, I need to animate them one by one? ...
0
votes
0answers
43 views

Unity Networking dedicated server hosting multiple game instances

I am making a multiplayer game on Unity that uses a dedicated server for the networking needs. From what I found a dedicated server is simply you Unity game compiled headless which only allows one ...
-1
votes
1answer
43 views

Detect the position of the mouse press? [closed]

I am encountering an extremely absurd phenomenon. When I run this code on my smartphone via Unity Remote or even on the computer, it works as expected. But when I install the APK on the device and run ...
1
vote
1answer
37 views

How to fix this unexpected movement?

I am facing a problem below is the detail. There are two scripts(actually more than two but these have the problem) Cannon.cs and Launch.cs and three buttons(up, down, and launch) to move cannon and ...
0
votes
2answers
74 views

Unity UI, how to hide on play

I have created a menu on Unity using the built in UI components,I can't create this on a seperate scene because I used the toggle button, which basically when you click it, it spawns a specific object ...
1
vote
1answer
58 views

Unity sidescroller with 3D objects/environment. Should I create a 2D or 3D project?

I'm looking to make a side-scroller in which the camera and all objects can only move in the x and y directions. However, I'm going to have all objects and environments as actual 3D models. Is it ...
0
votes
0answers
25 views

Preventing a NavMesh agent from moving Diagonally?

I'm currently working on a topdown game that uses 3D models. I am planning on using the NavMesh system in Unity to handle the movement of my NPCs, however, the NavMesh agents move diagonally when ...
0
votes
0answers
21 views

Physics related actions for interfaces of IPointerDownHandler, IPointerUpHandler vs. FixedUpdate in Unity?

I've been reading anything physics related in Unity should be handled in the FixedUpdate() call. Is this also the case when you implement the IPointerDownHandler and IPointerUpHandler interfaces and ...
1
vote
2answers
69 views

Unable to move GameObject?

This simulates a GameObject swinging between two positions. I am unable to manually move a GameObject on the Y axis using the Unity editor (in scene view) when the following script is attached and ...
2
votes
1answer
118 views

How do I “teleport” an object in Unity?

I'm trying to make a script where once a player triggers a collision they are teleported to another position that is determined by a empty game object. I think it has to do something with the ...
1
vote
0answers
23 views

Translate D3DXMatrixLookAtLH to Unity compatible code

I am currently trying to port a really old Game (I have the source of it) to Unity as a fun project. And I'm currently stuck with the object rotation techniques in Unity compared to the ones used in ...
0
votes
0answers
41 views

My Movement Function is working good but called only once

I have a function, It's working but not getting called every frame if It's in canMoveDown function but !canMoveDown its not. if (!canMoveDown && UpdateTilePhysics(currentBoardPiece)) like ...
0
votes
2answers
75 views

Unity UI Problems

I am using unity UI for the first time and trying to create a level selection menu just like angry birds. I had successfully created the dynamic level selection menu it was all good in the inspector ...
0
votes
1answer
61 views

Combine Unity games in one app

I want to combine multiple Unity games in one Unity app (or other framework if necessary). This app would have a bunch of buttons that will start the desired game. Is this possible and what would be ...
-1
votes
2answers
55 views

How can I implement Player Prefs to Save High scores in unity?

I am new to both unity and C# and facing trouble in saving and displaying the highscore.text in the game.Til now I only successfully managed to display the scoreUI and update them whenever player ...
0
votes
1answer
64 views

Can I use JavaScript for Unity 5? [duplicate]

Sorry for my bad English. I wanted to know how similar is JavaScript with Unity Script. I know that Unity Script is not JavaScript and it was done for marketing purposes but I just wanted to know if ...
1
vote
2answers
101 views

Player shooting himself when moving - Unity UNET

Setting : Creating my first multiplayer game and running into an odd issue. it's a tank game where players can shoot bullets and kill each other Problem : When the client shoots while moving, the ...
0
votes
1answer
46 views

Keep a rigidbody velocity constant

I have a "board" with a ball (rigidbody) moving over it and colliding with obstacles. I want its velocity magnitude to remain constant throughout time. How do I achieve this? What I've ...
0
votes
2answers
60 views

How to make a GameObject ignore a camera effect?

I have a 2D game and I wanted to apply bloom to the main GameObjects so I attached the effect onto the main camera, however the background also gets affected by the bloom and it gets all shiny. How ...
1
vote
0answers
57 views

How can I reduce the size of bundled Unity DLLs on Android? [duplicate]

I have created a simple project (I am a Unity beginner) for Android but the apk size is around 18 MB! I checked the documentation. One way to decrease the apk size is to check the editor log. Then I ...
0
votes
1answer
44 views

How can I check on a large number of points to see if they're inside the camera's frustum?

I have a locally stored database on my Android project, it is a database of approx 100,000 Point3D(double,double,double). I need to check if each of these points are inside of the camera's frustum in ...
0
votes
0answers
48 views

Object spawn only on Server in multiplayer unity3d game

In my game I have an object let say food, whoever eat that food that player will spawn one more element. I am sharing code here :- I am checking collision in Update. Following code is working fine on ...
0
votes
2answers
100 views

How to fix my tile-based game's tile movement code ? (like a CandyCrush Style)

I'm currently creating a tile-based game like a CandyCrush style direction movement (no problem on only down movement) trying to smooth, not laggy tile movement with a board piece, and I'm writing a ...
0
votes
1answer
50 views

Collision between UI element and GameObject

When I first started to develop in Unity I followed the Unity Tutorial for the Space Shooter 2D game and used the knowledge from that to create something myself. Looking at it now it may not have been ...
0
votes
0answers
62 views

How to load new scenes or models from network in unity or unreal engine?

I have a project to be done. I had done some research to accomplish some features. Event so, I couldn't find some answers. The project needs to have some features as follow; Charachter creation in ...
0
votes
1answer
33 views

Setting a Boolean as a field of an object from another script

I saw this question asked some times but no one correlates to mine. I see people using the GetComponent() function but this one should work too. First I receive a Bool value from a toggle button and ...
0
votes
1answer
65 views

Passing strings padded with white space into a byte[]

I am using Google Play services for a real time multiplayer game in Unity 3d. When sending the data in a byte[] in the multiplayer update I have to pad certain entries going into the byte[] with white ...
0
votes
1answer
44 views

Unity: Assign GameObject to Class that hasn't been yet instantiated

I'm creating a game where I have an Entity class that contains basic entity info (pos, health,..) and some functions. Enemies and Player later on inherit from this class. Public class Entity { ...
0
votes
0answers
61 views

Unity 5.3 Asynchronous Texture Upload in C#

I want to load textures asynchronous in C#. I heard it that it is possible to do it in Unity 5.3. However documentation doesn't mention how to do it in C#. Does anyone have an idea how it works? ...
0
votes
2answers
45 views

Unity3D mesh showing only black triangles

My mesh in the unity editor won't show the correct texture. Instead I get to see loads of black triangles. Anyone know what's wrong? thanks :)
0
votes
1answer
16 views

Blend trees does not get effect on some animations

I have created generic animations in unity where bike rotate to its left or right depending on what axis user is pressed. I have created several right turn animations though out of those ...
0
votes
0answers
27 views

How should I go about making hinges two-way, in Unity?

I have a basic rig made up, in Unity. It replicates the way a piston moves, in a car. To simplify it, I have a wheel connected to a cylinder, using the default hinge joint. If I move the wheel, the ...
0
votes
0answers
48 views

Communication between Photon Cloud game and web server [Unity3D; Photon]

I am creating a multiplayer game using Photon Cloud (Photon Unity Network). For storage of player data (profile, inventory, achievments) I use web server (asp.net mvc & sql server). How to ...
0
votes
1answer
64 views

Unity Change Ball Direction after hitting paddle in a Pong game (like in dx-ball)

I'm struggling with how to get the ball to change the bounce based on where it hits on the paddle. Normally in a pong game, the angle changes, depending on how far from center the ball bounces, and ...
1
vote
1answer
100 views

Initializing Consumable product to an amount on first use

I am using Unity's In App Purchase plugin to implement an in game store. In my game every player has fuel. I'd like to use the plugin in order to keep track of the amount of fuel the player has so ...
0
votes
0answers
14 views

Rigidbody constrains like to invert themselves

I have been all across the Internet for this particular issue, and have found no evidence of any body else having the same problem, but lately, I have noticed unity exhibiting weird reaction to values ...
2
votes
1answer
45 views

Unity rigidbody exhibits a premature max speed

In effort to build a racing simulator, I have been working on a working model for the pistons in the engine, and have come to a bit of a stand still. I have gone through extensive testing, through ...
3
votes
1answer
105 views

Can unity playerprefs fail to save, and if they do how can I check?

As the title says I would like to know if playerprefs can fail to save. If they can, is there some way to check if it save properly / if it failed? Example : if (playerprefsFailed) { ...
2
votes
1answer
131 views

Unity ignoring the deferred shader

I've been following this tutorial to get a cel-shader working in Unity 5 along with the standard shaders (explained in the last third of the article). My issue is that when I got to replacing the ...
0
votes
1answer
74 views

How to make my character double jump in unity3d using CharacterController?

I can now control my character in air, I used Unity's CharacterController.Move docs, but now I need to make my character double jump. Here's the code. public class PlayerMovement : MonoBehaviour { ...
0
votes
2answers
43 views

Draw rectangles on Cube and remove

I have 3d object as Wall ( Cube with texture and width and height large ) with some texture and attached c# ( Unity 5.3.2 ) script to that wall. I want to programmatically draw rectangles on that Wall ...