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 (2)

1
vote
3answers
242 views

Can't parent the standard FPSController during gameplay

I'm parenting the standard assets FPS controller during play with a simple script. The controller get's parented but also instantly inherits the rotation of the parent. This doesn't happen in Editor ...
0
votes
0answers
88 views

Visual Studio 2015 Unity Tools intellisense error

I just downloaded Unity 5. I use Visual Studio Community 2015 to edit the code. When i edit JavaScript files in VS it shows some of the Unity code as errors (for an example the #pragma strict). Also ...
0
votes
3answers
77 views

Math.Clamp won't limit my position until movement is ceased

The program is in a top down view, with Y going up (or forward depending upon how you see it), and X going from left to right based on the camera view. I am attempting to set the minimum and maximum ...
0
votes
1answer
101 views

Make Camera Bounds

I'm new here and I have a question. (Help me Google Translate). At first I make camera from this video. First video First script (CameraController) using UnityEngine; using System.Collections; ...
0
votes
0answers
33 views

Photon Connections without Concurrent Users? Or other networking?

I am going to be making a multiplayer game and use http://pupnp.sourceforge.net/ for setting up connections without having the player to port forward. The game will let you make or join a room using ...
0
votes
6answers
556 views

How to stop jumping again when character is in air (double jump)?

I'm using touch inputs in my game to control the character. I would like to know how to disable my character from jumping again in the air. if (FingerTouchy.phase == TouchPhase.Ended) ...
0
votes
1answer
41 views

Very less vertical transformation

Im using pretty basic code here charcter.transform.Translate(Vector2.up * speed * Time.deltaTime); Im using rigidbody 2d and I'm creating a platformer. When i press the button the character ...
0
votes
1answer
86 views

Handle two different touch gestures at same time without overlapping

I'm trying to create a Character touch controls for 2d platform. In my script Im using one horizontal swipe and hold touch gesture and one vertical swipe gesture without hold.Both are different ...
0
votes
1answer
54 views

Invoking a common method after a button press

I want to implement a common method that handles several numeric values and performs and action based on those values. So I have buttons with specific methods to change this values without affecting ...
1
vote
2answers
150 views

Optimization of Cube-based World

I'm currently working on taking an idea I've been toying with in C++ and bringing it into Unity, but I'm struggling to figure out how to make it performant and how to do things the "Unity way". My ...
12
votes
3answers
2k views

When should I use velocity versus addForce when dealing with player objects?

I'm confused about these two methods in the Unity framework. Both make the player object move, stop, change direction, etc. When should one be used over the other and when is one appropriate?
0
votes
0answers
32 views

Sprite animated position outside unity

our artist chose to animate the position outside unity because he want the precision of how the animations should look like what this means is when the monsters is jumping he literally moved the art ...
1
vote
2answers
180 views

Unity setting rectTransform on an UI Image with a Vector3, do I need to convert coords?

I am trying to build a menu with a cursor. I created the menu and that in the unity UICamera on the canvas. It looks great. I want the cursor to move so what I did was move the cursor by hand and ...
-16
votes
1answer
441 views

How can I “squeeze” a game object when it is pressed between two others?

I am trying to "squeeze" a game object when it's pressed between two other objects (e.g., "squeezer 1" and "squeezer 2," below) that continue to move towards eachother. I wish to reduce width of the ...
0
votes
1answer
65 views

Trouble GamePad input on iOS but works perfect on Android

I am having trouble getting input from on iOS devices (iPhone 6 Plus and iPad). Here is my code, if (Input.GetKey (KeyCode.JoystickButton14))// A { chr_show = "A"; } if (Input....
7
votes
1answer
2k views

How to not freeze the main thread in Unity?

I have a level generation algorithm that is computationally heavy. As such, calling it always results in the game screen freezing. How can I place the function on a second thread while the game still ...
0
votes
2answers
104 views

How to make my Object Zig Zag

I have an object in 3D space with a certain height (y) component that I wish to remain constant. The object is a rigidbody, kinematic, affected by gravity and a trigger. So I tried this method ...
1
vote
2answers
179 views

What is the most efficient technique for range detection?

I have a bunch of patrolling enemies that fire projectiles when the player is in projectile range - a specific radius. Which method is the most efficient and elegant? overlapSphere sphereCast ...
6
votes
1answer
315 views

How do I properly light characters in a Unity scene?

I made a game prototype and want to improve some of rendering the visuals through light baking (which I'm new to). While I was mostly able to do this in my environiments, I'm having issues doing this ...
-3
votes
2answers
286 views

Random AI Movement

So I'm creating a zombie game where the zombies are passive and just walk randomly all over the area when player is not near. My question is: how would I make zombies move randomly? I code in C#. ...
3
votes
1answer
112 views

Distinguish touch gestures for distinct horizontal and vertical commands

In my script below I'm using horizontal and vertical swipe gesture to move the character but both gestures are called on a single touch. void Update () { HorizontalSwipe(); VerticalSwipe(); } ...
0
votes
0answers
45 views

How to create custom editor script only for one field of an object and leave the rest default in Unity?

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write ...
0
votes
1answer
179 views

Why am I getting this “tag not defined” error?

In the log, it says UnityException: Tag: car is not defined. at PlayerController.OnTriggerEnter (UnityEngine.Collider other) [0x00000] in <filename unknown>:0 I'm checking against the tag ...
-1
votes
1answer
62 views

Combining Pause and Start Menu

I got my pause menu working by using this code: using UnityEngine; using System.Collections; public class PauseMenu : MonoBehaviour { public GameObject pauseUI; private bool paused = false; void ...
0
votes
1answer
69 views

Swipe and hold character movement not working

Heres my PlayerControl script void Update () { foreach (Touch FingerTouch in Input.touches) { if(FingerTouch.phase == TouchPhase.Began) { FingerInitialPosition=...
0
votes
1answer
92 views

Basic Moving/Anim Script [Unity CSharp]

So, I got this to do the anims for my sprite in Unity 2d... using UnityEngine; using System.Collections; public class Move : MonoBehaviour { public float Speed = 2; Animator anim; // Use this for ...
0
votes
1answer
73 views

Keeping camera at player's back

I'm developing a 3D game similar to the Roller Ball game from Unity's tutorials mixed with a runner type game like Subway Surfers. The game uses the arrow keys for control. When the player hits the ...
4
votes
1answer
257 views

How do I expose a field with a generic class to the Inspector?

I have some utilities implemented as generic classes. I would like to have fields of these types exposed to the inspector but they appear to not display. This test code: [Serializable] public class ...
-3
votes
1answer
49 views

How/where can i learn everything unity2d [closed]

I just learnt unity basics and would like to learn everything else related to 2d development beginner to advanced in less time. Because i dont want to stick to game business/development for a long ...
0
votes
2answers
87 views

Trying to use yield to wait for a few seconds to avoid the sounds from Interfering with each other

Ok so when my player hits a wall (Enemy tag). My player is destroyed after a certain amount of time. During this time, I disabled the mesh renderer on impact so it "appears" as if the player is ...
3
votes
1answer
176 views

Why do my .wav sound effects delay before playing the first time on iOS?

First off, I'm using Unity 5.2.3. I have a bunch of .wav sounds that I play like this: Debug.Log(m_audioAssets.m_soundBanks[(int)m_currentSoundBank].m_multiplier[data].loadState); ...
0
votes
1answer
108 views

Distance based item interaction

I'm having an odd issue in my implementation of distance based object interaction in Unity. Basically it's a simple "Press [key] to [search/pickup/open/etc]" function which requires the player to be ...
0
votes
0answers
21 views

How to use camera in unity engine?

i'm new to game development, and i want to learn more about camera programming in unity. I am good in C#, so scripting is not my weak point. I dont really know how to start. Could you please refer ...
2
votes
1answer
63 views

How do I expose a field of an abstract type to the Inspector?

I have a class hierarchy with an abstract parent class. I would like to have a field of this type exposed to the inspector but it appears to not display. This test code: [Serializable] public ...
2
votes
0answers
84 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 ...
1
vote
1answer
172 views

Is it possible to interpolate different sprites? [duplicate]

I can interpolate different animations based on position, rotation, and scale. I want to do the same for different sprites, automatically. For example, lets say I have a soda can being crushed. I ...
1
vote
1answer
141 views

How do I make a 2D sprite flash green when tapped?

I have a sprite that is based on an image of a gray circle. When the user touches the sprite, I want the sprite to flash green, as in I want the circle to appear to turn green for 0.2 seconds. I tried ...
0
votes
1answer
84 views

How to Implement a Timer for my Prefab for Roll-a-Ball Game (C# in Unity)

I am trying to create a public float timer that senses when the particular prefab has not been there for a certain amount of time. Then, it will replace that particular object. The goal is to ...
0
votes
0answers
115 views

Spatial based Augmented Reality with Unity

I want to create an augmented reality application that is based on a spatial / location based overlays. Similarly to Infraworks by Autodesk or Flight Radar 24, the user will hold the device vertically ...
0
votes
1answer
130 views

Facebook Unity SDK Share Callback Returns Success When User Cancels

Here is the code piece i used to debug: public void Share (FacebookPost post) { FacebookDelegate<IShareResult> innerCallback = (result) => { foreach (var item in result....
0
votes
1answer
65 views

how to transform the position of an object

I am trying to transform the position of an object. I have totally 3 Objects and 2 triggers, objects are 1. Left_Wall, 2. Right_Wall, 3. Obstacles. 1st trigger for transform the position of an objects ...
-1
votes
1answer
66 views

This if statement doesn't end once triggered by touch

I have an if statement that successfully recognizes a touch, but continues executing after the touch has ended. void Update() { float currentstep = speed * Time.deltaTime; Vector3 ...
2
votes
2answers
169 views

About tiles in games

I'm trying to learn how to develop games in Unity and my base is tiled games, I would like to know if a simple tile is an image (sprite in 2D) or a game object in 3D. Since I'm trying to do some kind ...
0
votes
0answers
63 views

cannot sync for connected player after spawning meteorite ( photon PUN and ufps)

did anyone run into such bug? It happens when second player connects to a game, and that's what he sees. But players who connected earlier see everything well: meteors which I spawn by master-client ...
2
votes
1answer
150 views

Why is Unity UI Image color not being animated? [closed]

Animation is changing the color of an UI Image but the color only changes only in the inspector but not Game/Scene view. In this video I demonstrate the problem clearly.
0
votes
1answer
287 views

Unity not opening

When I start my Unity it opens up the menu where I can select a project, but when I pick a project nothing happens. The process is still running in my windows but nothing shows up. Here is my log file:...
0
votes
1answer
150 views

Why is FindObjectOfType(MyType) not finding anything?

Why would I get the following log? Start OpponentMotionReceiver motion receiver not found true public class ScoreAnimation : MonoBehaviour { private OpponentMotionReceiver ...
0
votes
0answers
52 views

Is it possible to use a Unity 3d Model with libGDX?

Can I use a 3d model like https://www.assetstore.unity3d.com/en/#!/content/36951 in a libGDX 3d game?
2
votes
1answer
94 views

Transitioning through menus in Unity: what is the best option performance-wise? [closed]

I'm making a menu manager and I'm not sure what should I do to make a transition from one menu to the other. What is better to be used performance wise? Here is the step in my mind. Simple enable or ...
3
votes
2answers
381 views

Play soundcloud in Unity 3d

I'm trying to make a game with cool soundtracks from a bunch of artists. I've made a few playlists in Soundcloud (soundcloud.com) and am trying to get those to play inside of Unity 3d. Is it possible ...