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
0answers
22 views

UNET Performance of (many) Kinematic Rigidbodies

I am building a game in Unity in C# using the UNET networking elements. I am trying to figure out what is the performance cost of kinematic rigidbodies? My understanding is that, when kinematic, ...
1
vote
1answer
24 views

IsolatedStorageException : Could not find file

I'm trying to save/load player data from a file using the persistenceDataPath using the following code: private void Save() { if (File.Exists (Application.persistentDataPath + "/...
-1
votes
0answers
24 views

Unity player prefab issue [on hold]

I am using this tutorial . http://unity3d.com/learn/tutorials/topics/multiplayer-networking I am up to step 5. I have filled everything to the tutorial however when I try drag in the player prefab it ...
1
vote
1answer
24 views

StartCoroutine from other MonoBehaviour is not working

I am trying to replicate the model of Unity documentation about coroutines, but I want to partition it in another class: I have these two: public class A: MonoBehaviour { void Start() { ...
0
votes
1answer
31 views

How can i exclude “Y” from drag in unity?

I'm trying to make a moving object drag when no input is received, but i want the drag to only apply to X and Z variables, and not Y. Meaning i want it to fall at a normal speed, but when i stop ...
1
vote
0answers
23 views

Unity3d Isometric moving forwards

I am making an isometric game using unity 3d and 3d graphics. I have been able to figure out how to create and isometric camera that follows the player, and a basic isometric moving script for the ...
0
votes
0answers
27 views

I have a zooming and parallax related issue in 2D game in Unity. [closed]

My 2d game have zoom in-out feature. And I have some objects as background of game that I don't want to zoom feature work for those objects. something like parallax. Here is my code: public class ...
1
vote
0answers
29 views

How can I get UI element over which pointer is in Unity3D?

I can detect if mouse is hovering any UI element by EventSystem.current.IsPointerOverGameObject(). But how do I know which GameObjest it is exactly? I have tried: if (EventSystem.current....
1
vote
0answers
16 views

How to add all MonoBehaviours of Scene into the List?

I've read an article 10000 UPDATE() CALLS. Author uses UpdateManager. It has Update method which calls Update method in all of other MonoBehaviours of objects. It works faster than calling Update ...
1
vote
2answers
29 views

unity Tilt Android Device player Freeze When Die

I attached tilt script to my Player to move player x and y Axis. Player have Rigidbody2D and also IsKinematic=true. but the problem when the player can Die i want to stop tilting and player goes down ...
1
vote
0answers
28 views

How can I create click and drag for a 3D Jenga game in Unity?

Essentially, I am trying to create a game that mimics Jenga. Right now I have made it so that the blocks collide with each other and have gravity, everything works very well. The one thing that I am ...
1
vote
0answers
25 views

Top down controller script trouble

My game features a top down camera that follows the player as he moves via virtual joystick on a cellphone screen. I want the movement of the player to always walk forward and the direction will be ...
1
vote
0answers
11 views

How do I transition from anystate to die animation on Unity 5

I am using Unity 3d (5.40b, it's the latest version). I tried to trigger the animation with a trigger parameter. I couldn't get animation to trigger. Doing it that way it said something like "...
1
vote
0answers
22 views

Unity 2D animation running partially

I have a 2D skeleton animation of human walk cycle - which is fine. I am trying hard to code that should STOP only hands animation but legs should not (on a player input - for example on space bar ...
0
votes
0answers
40 views

How to make an explosion in unity c#? [closed]

I am trying to add a grenade launcher to my fps game in unity. I want the grenade to explode when it hit the ground. The explosion shouldn't destroy the ground but it should have an explosion effect ...
2
votes
1answer
18 views

Unity VR: How to draw camera on top of VRSettings.showDeviceView mirroring

We're using VRSettings.showDeviceView = true to mirror the VR display to the main window. We also have a camera that we'd like to draw over top of the main window's mirrored VR image. This other ...
2
votes
1answer
53 views

How can I create a copy of an object in Unity?

I'm new to unity. How can I make some copies of my GameObject in Unity by scripting? I have tried this by the way: public GameObject stone_3; void Start () { for (int i = 0; i < 10; i++) ...
3
votes
0answers
33 views

Unity Capture And Display Live Camera Feed

I want to display the video using the device camera on specific part of the screen on iOS, android and Editor. I was able to find the WebCamTexture which display the camera video on the Quad (3D ...
1
vote
1answer
24 views

Add Smooth Force to Player Rigidbody

I am trying to add force to player's rigidbody, when the screen is held. I've written following code for that. float PlayerForce=50.0f; void FixedUpdate() { bool PlayerActive = Input.GetButton ("...
1
vote
2answers
43 views

Camera relative movement is pushing into/off the ground instead of parallel

I'm building upon roll a ball tutorial in unity, and I have managed to rotate the camera around the ball just fine with the code below. But there's one problem. In this code, when I add force to the ...
1
vote
2answers
50 views

Counting triangles and vertices in Unity's cube

I want to understand logic behind drawing triangles of primitives in Unity. When we spawn simple cube, variable mesh.vertexCount gives us value 24. Also when we list all vertices positions (from mesh....
1
vote
1answer
37 views

convert clock input into 24 hour format

I have stuck in a logical problem I have a third party package of DayNight. It takes hours input(24-hour-format) to show dayNight effects in scene My code is to transform 12 hours clock cycle into 24 ...
1
vote
0answers
38 views

Position values magically flipping signs

I'm trying to make a 2D sliding puzzle game (like 15 puzzle). My main problem is getting the squares to stop just before they touch. I don't want to use colliders because I'm scared they might pop out ...
1
vote
2answers
35 views

Unity2D - move rigidbody object with collision

How do I move and collide my object (position given by touch or click), by Using rigidBody2D.MovePosition i can only teleport my character, and by using velocity, my character keeps moving, I want him ...
1
vote
1answer
83 views

How do I merge colliders in a tile-based game?

I'm doing a tiled based platformer in unity, and I was having some issues with collisions and I figured the problem was the way my colliders were arranged. So right now, my collision look like this: ...
1
vote
1answer
134 views

How do games like Street Fighter compensate for bad frame rates?

I know fighting games like Street Fighter like to run and are capped to a standard 60 fps. All their combos, animations, chains, etc... are based on frames. So, how do they compensate for slowdowns ...
1
vote
1answer
68 views

Why do I get an infinite loop created by a subtraction in Unity3D? [closed]

Does anyone have a solution to this ? When I do the subtraction , it makes a loop that does not stop. if ((lamp.activeSelf == true)&&(test == true)) { money = money - 50; /...
0
votes
0answers
19 views

Toggle between function in unity [closed]

I want to toggle between function with the left mouse click. So basically, I want my the screen to start with displaying func1(func1 is activated), then when you press the left mouse buttonfunc1 gets ...
1
vote
1answer
41 views

Unity 2D animation issue

I have this weird animation bug in Unity that I believe is how Unity handles the frame. I dont know how to show the image so I'll do my best to explain it. So I put a bunch of 2D sprites in a ...
-1
votes
0answers
44 views

Why does my code crash on sign-in with Google Play? [closed]

I just updated GooglePlayGames plugin for Unity. My code worked fine before I updated the plugin but now my game crashes on sign in. public class Signin : MonoBehaviour { void Start () {...
-3
votes
1answer
37 views

Repeating an anim at various positions in unity 2d

I never worked in unity 2d before. I just started developing a 2d game couple of days back. The gameplay of my game is almost similar to flappy bird. I successfully imported an animation file (.anim ...
1
vote
2answers
34 views

Replace PolygonCollider2D with MeshCollider at runtime

I am using a PolygonCollider2D to load in points for a MeshCollider at runtime, but am having issues switching between the two at runtime using good coding practices. This is a simplified version of ...
1
vote
0answers
34 views

My orbit code produces the wrong results

I have a GameObject called "Sun" in the sky. A game object called "GameManager" keeps track of time in the game, it is responsible for updating the hours and days. For my sun I do something like this ...
1
vote
0answers
37 views

I keep getting a type/namespace error when I try to define my two motion controllers. What am I doing wrong?

I'm trying to get motion controls working (particularly making it act like a joystick) but I keep getting this error "The type or namespace name 'SteamVR_Controller' could not be found (are you ...
1
vote
1answer
38 views

How do you get audio clips to play on all clients?

I am new to networking with so this is probably a noob question. For context I am trying to get a gunshot sound effect to play and be heard by all players.
1
vote
1answer
56 views

2 cameras that each player sees through a different one

Im very new to Networking in Unity 5. Im trying to bring the finished basis for my 2 player, 1 vs 1, turn-based game I made for local multiplayer (both players on same computer) to an online ...
0
votes
0answers
19 views

terrainData.SetAlphamaps slows unity game

iam using terrainData.SetAlphamaps() function for changing texture of specific part of terrain in update which is like my player moves and i get its transformation and map the texture at corresponding ...
0
votes
1answer
74 views

Need Help With My Script And Animator. I am encountering a few bugs with it

Okay so I have created a player archer character which when he using the arrow keys, faces those directions and upon hitting space when in that direction, the bow attack animation is played. The code ...
1
vote
1answer
130 views

Making Cave system in Unity 5

I know there are many threads about this but none of them seems to work for me and I spent like 2 days already on that problem. Things that I've checked: http://wiki.unity3d.com/index.php/...
1
vote
1answer
17 views

How do I get the InputManager to recognize a certain axis/Vector2D with a Vive motion controller?

Right. So basically I want to map the Vive motion controller touchpads (certain locations) to the certain inputs in Unity's InputManager. How do I do this? Like I want a certain area on the touchpad ...
0
votes
2answers
30 views

How can I get all components of a type from a List with mixed components?

I have a list of GameObjects. Half of these GameObjects have Component1, and the other half have Component2. I want to get all of Component1 from the list. So an example of my list: var list = new ...
3
votes
1answer
32 views

How to edit and persist serializable Assets in the Editor Window?

I have an asset saved in my project which represents a serializable scriptable object. Code of the object is very simple: using UnityEngine; using System.Collections; public class TestScriptable : ...
1
vote
1answer
47 views

Print string letter by letter in UI Text

i'm trying to print a string letter by letter for UI Text of Unity. With each click of a button, the Stampa function, must print a letter. Up to this point everything is working perfectly. But if I ...
0
votes
2answers
52 views

smooth loading of the heavy scene in unity3d

I have a very very big/huge scene to load, I can't load it at once. So what I know I have applied but it still loading takes some time I want to make it smooth. How it possible? What i have tried so ...
0
votes
2answers
53 views

Random Functions in Unity [closed]

Is their a way to execute or call a random function in unity. Something like:- void Update(){random(func1(),func2())} void func1(){print("func1")} void func2(){print("func2")}
0
votes
0answers
35 views

How to apply physics on multiple sphere after collide like in Snooker game in unity?

I'm new in unity developement. I want to develop android game application Kanche(Marble). It's marble based game. Player need to take out other marbles from circle. What I've tried so far is, Rall a ...
-1
votes
1answer
54 views

What properties should be private, public, and protected? [closed]

I'm currently trying to write a base player class, and I'm not exactly sure what I should make private, and what I should make public. I know that as a programmer, I need to keep as many variables as ...
1
vote
1answer
88 views

Creating a list of buttons dynamically in code

I have a list of contacts. I need to create a scrollable list of buttons that are created dynamically so I can add each contact name as the button text. How would I do this all in code? My biggest ...
0
votes
1answer
55 views

Move around object

I have problem with Unity - 2D objects. I want to rotate object around circle and on click translate it (with same angle) outside the circle to another and still rotate. Rotating is working with ...
1
vote
0answers
26 views

I can't log in Unity on Linux [closed]

I use Linux Mint 18 Sarah 64-bit version with Cinnamon. I've decided to install Unity3d 5.1.0f3 from following website: http://blogs.unity3d.com/2015/08/26/unity-comes-to-linux-experimental-build-...