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
2answers
76 views

Doing object movement in a loop in unity

I have a Game Object at position (0, 0, 0). To move it to position (2, 2, 2), I'm using this code below - void Update () { Vector3 TargetPosition = new Vector3(2, 2, 2); transform.position = ...
1
vote
1answer
86 views

Instantiating prefabs dynamically in script

I have a canvas object. I right click it and add a Button, which defaults to having a rect transform, image script, button script and text child object. I make it a prefab and delete it from my ...
1
vote
1answer
38 views

Why do Unity networking libraries fail when building for the Windows Store?

I am using Lidgren and RSA in my networking framework, but things like IPAddress are "nonexistent" when I try building for windows store. RSA classes don't work, either. Why is this? How could I ...
0
votes
1answer
49 views

Any way to visualize how will game objects look on different screens?

After completing my game and sending it to a bunch of friends with different devices, they complained about how some game buttons were too small. (I have developped a touchscreen game but after ...
0
votes
1answer
53 views

Outline of plane slice of arbitrary object

How would you extract the outline of a shape from slicing a plane through an arbitrary object? Note: This is related to my Unity Answers question, but not exactly the same.
1
vote
0answers
44 views

How can I hide an object for one eye for the unity oculus rift DK2 platform?

I am trying to build a game for my son for the Oculus Rift DK2 to help treat his lazy eye using Unity. I need objects that: Appear only to his left eye Appear only to his right eye Appear for ...
0
votes
1answer
64 views

Unity 2D: Change one instanced prefab then make all the others on the scene like it

I want to get this thing working: I have a prefab with coins, some obstacles and enemies, and i want it to be instantiated each time the player got to the right or left on the stage, to make the stage ...
0
votes
2answers
136 views

Is it possible to use one if statement for each level scene?

I'm working on a platform game where you as a player have to collect logs, to keep on all the fires in the level. Each campfire has a timer, which ensures that every x number of seconds the animation ...
0
votes
2answers
74 views

Detecting on which side did the objects collided unity 2d

I have a ball and a rectangle in my game. The rectangle has a box collider 2d attached to it. How can I calculate or check when the ball hits the top of my collider, when it hits the bottom, left and ...
0
votes
0answers
64 views

How to slow down a Sphere smoothly in a world controlled by force and stop it (Unity 5)?

I am a beginner and I started to use Unity 5. I play with tutorials on the site and documentation. I was basically testing springs, physics materials etc. I have a problem understanding probably a ...
0
votes
2answers
63 views

2D physics on game object made up of components

Say you want to let your users create a 2D airship (side view) made up of components. One component could be a floating balloon, another could be a storage room, etc. And say you want this airship to ...
0
votes
0answers
35 views

Unity Buttons and selecting Objects

I'm making a tower Defence Game. and my buttons are working fine... Until i select and unselect a tower. what I've worked out, is that after I've selected a tower the follow section of code sets my ...
0
votes
0answers
72 views

Unity 2D Game: Camera following target and looping stage

I'm with a problem and I need some help, because I'm on early learning of gaming and Unity, and i want to learn doing it, so, i need all the help, you developers know how each little help, helps a ...
-2
votes
1answer
52 views

Unity skips menu screen and goes to next scene

I am using Unity 4.6.1 and I am working on a game project. I created a JS script with Application.LoadLevel to go to the next scene. Here is my code for OnGUI: function OnGUI () { { ...
0
votes
1answer
86 views

Loading Screen And Coroutines Unity

When I want to load another scene and show my loading screen to the user - my loading screen is a game object holding a canvas, I use coroutines, but when I type something like this: ...
-1
votes
2answers
59 views

Get position of currently instantiated object [closed]

I have Variable Temp which is Vector3. And i have variable next which is of type Transform. In the inespector, i have dragged an empty gameobject to "next". In my update, i have: temp=new ...
0
votes
0answers
228 views

Issues with character controller (unity 4 project in unity 5)

I'm having the weirdest issues with a game me and a mate have been working on. They came up immediately after moving from the last version of Unity 4 to Unity 5. The two objects (player and enemy) ...
0
votes
1answer
74 views

How to modify the Unity sprite renderer (or create a custom one) that can display the sprites on the X-Z plane?

Prefix: I am NOT trying to rotate a sprite 90 degrees by it's transform, this changes what is up/down and forward/backwards for the object. I need the sprite displayed on the X-Z plane in comparison ...
1
vote
1answer
63 views

Determine which face of a cube is facing the camera

I have a Cube with a unique color for each face. I made a script where I can swipe and rotate the Cube in increments of 90 degrees in each direction. what's the best way to determine which face of a ...
1
vote
1answer
44 views

Check for collision without any built-in collision functions

Is it possible to check for a collision between gameObjects without using the built-in functions OnCollisionEnter, OnCollisionStay, or OnCollisionExit? Preferably a solution without the use of ...
0
votes
1answer
32 views

Unity only rendering certian parts of 3d building model from certian angles

So I made a couple modular building sections in blender, modular in the sense that I can insert build a floor at a time. I transferred them into Unity and then I got a rendering error that I have ...
0
votes
0answers
68 views

Creating a 2D game on the X-Z plane instead of the X-Y plane in Unity, any adverse effects or challenges with this?

After coming to the realization that some things I wish to do in a 2D RTS are easier to do on the X-Z plane instead of the default X-Y plane, I'm considering moving my game over to the other plane. ...
1
vote
1answer
65 views

Why the size of my game increased on deploying it to Android using Unity3D?

When I deployed the game to 'Web Player', it's size was just 2.4 MB but when I deployed it to 'Android', it's size got increased to 38 MB. Why this happened? Please answer this, I can't provide any ...
0
votes
0answers
38 views

Server send commands to client side AI

Hello everybody i have recently found Unity3D, now i am planning to develop a Network-based game( not going to release it or anything like that, just for the experience of going from bottom to top). I ...
0
votes
0answers
36 views

How do I use two or more shaders in the same object in unity

ok guys, so I have a basic ramp shader I copy from the unity shader cookbook. It's just a basic ramp shader. And then I got another shader I got from the unity shaders wiki, which is basically an ...
0
votes
1answer
56 views

Coding a left/right object movement C# script for android phones in unity

I have 2 spheres and a cube on screen. I'm experimenting to make a 'left/right movement script' for the cube so that when I touch the left sphere, the cube moves left-wards and when I touch the ...
1
vote
1answer
91 views

Collision, triggering, and range detection in an RTS. What are the optimal solutions for unit spatial awareness?

I've finally ran into the problem of multiple triggers and collisions within my 2D RTS. Up till now I've been using unities sphere colliders as a way of simulating spatial awareness. To trigger when ...
0
votes
0answers
30 views

How to hide an object when a character enters it?

I have written the code for my character : void OnTriggerEnter2D (Collider2D other) { if (other.tag == "Star") { } } When my character enters or passes the 2D object, I want to ...
0
votes
1answer
104 views

How to bounce the player away after attack by enemies?

I creating a 2d platform game. I would like to bounce the player away after hit by the enemy, so the user get another feedback beside the sound effect. How can I achieve my wish? Use the following ...
0
votes
1answer
79 views

Unity C# 2D Platformer Main Camera should stop on sides of level

I've been working on a 2D Platformer and i succeeded in setting up a script for my Main Camera to follow my Player gameobject using transform positions. Now when my character is near the sides (or ...
0
votes
0answers
19 views

C# Pathfinding in 2d array (procedural generation) [duplicate]

I have the following random example data in a 2d array 030 300 030 003 The 3 represents a room, the 0 represents its an empty block and 1 represents a corridor. Now i want for example the following ...
0
votes
0answers
74 views

i cant animate my character using animator controller

i have been stuck with the following project for a couple of days now. no matter what i do i cant make my character transition between idle and walk animation. i have been tweeking almost every option ...
0
votes
1answer
35 views

How to play Sound of a Destroyed Object

So I have implemented grenades, and thats working fine. Now I want some explosion sound, but the problem is that the sound is still playing when the grenade is explode and I Destroy the grenade. Does ...
0
votes
1answer
43 views

Everything black except where there's a light

I have a camera in my scene with a map created at runtime: As you can see everything can be seen. Now I want the map to be invisible (black as the background) except where there are lights. How can ...
0
votes
0answers
22 views

Trouble with Inaccurate Mesh Collider

I'm stumped as to why (sometimes) when I apply a Mesh Collider to a procedurally create mesh, it is sometimes completely correct, but other times completely inaccurate. In Detail: I'm creating a ...
0
votes
2answers
83 views

How to play a sound by C# that is linked to the object with AudioSource?

I trying to play a sound while the player is ontriggerenter. The sound is linked to the object with a AudioSource component. But notting happened. using UnityEngine; using System; using ...
0
votes
2answers
187 views

Unity C# 2D Platformer Enemy Patrolling

I'm setting up a basic mario-like 2D Platformer and i'm trying to give 'enemies' a patrolling path on a platform. (just like the turtles in Super Mario Bros). All they do is patroll from left to right ...
1
vote
1answer
56 views

Why is rotation not applied instantly?

I am working though the Space Shoot tutorial and I have just applied tilt to the player object. One of the things that I have noticed is that the tilt is not applied instantly but instead the player ...
-2
votes
2answers
87 views

In Unity, how do I make the camera follow a character?

When my character moves, I want the camera to follow them, such that the character always stays in the middle of the view. How do I do that in Unity? Here's my code right now: using UnityEngine; ...
1
vote
1answer
62 views

How to change an int value in the Unity editor

The player of my game can collect logs and can use them for hold on the fires. Each fire has its own status. So one is off and the other one is for 50% on. I created a public int inside my script ...
0
votes
1answer
43 views

Creating procedural mesh with orientation

I am working on creating a procedural cylinder mesh with Unity C#. I have everything working but there is one thing I would like to implement in my existing code is to define a vector3 halfAxis which ...
5
votes
2answers
179 views

(Unity) Is there a way to automatically create a material for each texture and assign the texture to it?

I have imported hundreds of textures in my Unity project, and I'd like to create a material for each of them. This would obviously take a lot of time, so how would I go about doing this automatically? ...
0
votes
1answer
71 views

Unity problems with OnTriggerStay and Input.GetKeyDown

Background information Some weeks ago, I start by creating my own platform game. You control a character, that can collect logs and should hold all the campfires on in the game. When the user has ...
2
votes
2answers
83 views

How do I keep my orbiting camera upright?

I am working on code that rotates the camera around a point on the in-game map when dragging the mouse. I understand how to lock it so it stays above the map surface. However, if I keep rotating the ...
0
votes
1answer
48 views

Script attached to one button triggers other buttons too in unity

As you can see in the image above, I have 4 buttons. I have attached a C# script to only one button to change the scene on click. Now the scene should change only when I click on the button to ...
0
votes
1answer
66 views

submeshes and dynamic batching doesnt work as expected

I'm duplicating one object with submeshes frequently, and assigning a random material from five materials to each submesh. There is batching happening, but it's not quite as efficient as I would have ...
1
vote
2answers
117 views

Best way to constrain character to a path?

I'm in the process of developing a level-based runner for mobile phones, and I've hit a wall when deciding which method to use to get the character to move through the level. Basically - I need my ...
0
votes
0answers
14 views

Change pointerDrag target during a drag

In Unity, I am trying to change which GameObject is receiving drag messages from my EventSystem's StandaloneTouchInputModule. E.g., while I'm dragging one object, a script reassigns who is receiving ...
2
votes
1answer
62 views

Do I have to commit the downloadable assets for Unity to the repo? Or a reference for the team to download them?

QUESTION (Short version) I am going to use the Unity Test Tools asset to do unitary testing. Q: Do I have to commit the Unity Test Tools to my repo? (using git, by the way). CONTEXT Team / Workflow ...
1
vote
0answers
60 views

Recreating iPhone Home Screen in Unity

I am trying to recreate a UI menu that has functionality similar to the iPhone's home screen: If a user drags anywhere on the menu (including on a button), it should drag the whole page left/right ...