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

Is it possible to use nav-mesh in 2d game in Unity?

I'm working on game that needs navigation and obstacle avoidance. I've used nav-mesh on 3d project before but now I'm trying to use it in 2d sprite game but it seems like it doesn't work. I want to ...
0
votes
0answers
28 views

Undesired Rotation Produced by Mouse [duplicate]

I have the following C# script for my gameobject:- mousey = Input.GetAxis ("Mouse Y") * sensitivity * Time.deltaTime; mousex = Input.GetAxis ("Mouse X") * sensitivity * Time.deltaTime; transform....
0
votes
1answer
53 views

Access buttons individually made by a for loop (old Unity GUI, Unity Editor script)

I've got a problem and I am struggling with this for a couple of days now. I am making an Editor script and I want to access buttons individually when created by a for loop. There is a public class ...
0
votes
2answers
67 views

Pass Vector2 to Instantiated GameObject

I am trying to get an AI sprite to randomly shoot a SINGLE bullet while walking around. This is a 2D Top-down perspective. The sprite can move up, down, left and right. It randomly changes directions. ...
0
votes
1answer
43 views

Unity - Copy another object's Y location?

I'm creating a Pong clone inside of Unity and was trying to figure how to copy another object (In this case being the Y co-od of the Ball Object) How would i go about doing this? I'm using vectors as ...
0
votes
1answer
46 views

Updating a gameobject position that needs to be consistent across all players' games

I am creating a real time multiplayer game in Unity 3d using Google Player Services that has a ball that the players will interact with. I'm not particularly sure how I will update the ball's position ...
0
votes
0answers
50 views

Targeting Player When Zooming Camera

I am zooming Camera when player dies, but it rotates entire screen, that is not preferable. Is there any way to zooming camera, as well as targeting player. The following code I've used for zooming ...
0
votes
0answers
64 views

Unity 5.3.1: Black spots on terrain after applying normal map

When applying a normal to a terrain texture and elevate the area, I see blackness on the side the light is shining. Any idea what is going on here? Here you can see what i mean (added cube to show ...
0
votes
0answers
66 views

Problem with google analytics referral tracking in Unity3D game on Android

In my recent game I used google analytics plugin for unity. Link here: https://github.com/googleanalytics/google-analytics-plugin-for-unity Everything works fine but I'm unable to track install ...
3
votes
1answer
70 views

Is it Possible to play Musics / Songs stored in the mobile to play inside the game?

hi I am creating a car game, I just like to know is there is any way to play the musics Stored in our phone to play inside a game? If the player select MP3 player the songs stored in the mobile wants ...
0
votes
1answer
150 views

Game states & passing data between scenes

I'm not entirely sure if I'm doing this right, but I always considered the scene system in Unity as some sort of state management (rather than e.g. a level system) which allows to group the contents (...
0
votes
0answers
97 views

vert/frag custom shader - Shadow is not correct, showing strange artifacts

I am new to shader writing, I want to drop shadows in my own shader, but unluckily I am getting a strange behaviour. When I apply a simple surface shader (Lambert, written in unity shader lab) it ...
0
votes
3answers
81 views

Trying to get two variables to stay in sync between 2 scripts. Anyone know what the issue is?

Basically I am making an inventory system where the player has a set amount of objects, and if they go to a pickup then it will give them more of that particular type of object. I have two problems ...
0
votes
2answers
134 views

Picking a 2D Box Collider with the mouse in Unity

I have a scene with a bunch of 2D doors that have 2d Box Colliders (no trigger) on them and that live on a Canvas. I would like to be able to click on them with the mouse, but have had no luck. ...
0
votes
1answer
73 views

Script for non-stop enabling/disabling “Is trigger” on collliders2d in Unity3D?

I had asked before that I have a problem with too many colliders in one spot and that some upgrades of towers I have are buggy due to that. It has come to my notice, that whenever I enable the "Is ...
0
votes
0answers
16 views

How do I properly “attach” an image on a GameObject? [duplicate]

How do I properly "attach" an image on a GameObject? I have tried adding a GUI Texture component to the GameObject but it ends up being very big.
3
votes
2answers
108 views

How would I create a billboard that is fixed to my camera's farplane?

I'm trying to set a GameObject(plane) to be positioned at my camera's farplane. I plan on using this billboard as a sort of dynamic skybox. How would I create a billboard that is fixed to my camera's ...
0
votes
1answer
46 views

Text field is null while running but not in inspector

I've encountered a strange problem. In my game I have a prefab called UiManager. It has two public Text-fields, one for score, and one for lives. I only have one instance of this prefab and I've ...
0
votes
3answers
203 views

Start Countdown on Resuming Game (Unity)

I am pausing game by setting Time.timeScale to 0. And When the Game resumes Time.timeScale is set to 1f again, and game resumes. Now I want to add timer before actually resuming game. It shows 3,2,1,...
0
votes
1answer
82 views

how to start the game without entering into menu screen

i am trying to play the game without entering to menu screen. i have placed only one scene. my ui and game both is placed within the same scene. in my game over screen i have two buttons. for home ...
0
votes
0answers
51 views

Re-use DOTween tweeners

I am using DOTween, and I want to create a tweener, store it, and re-use it in the future several times. Tweener playerMoveUpTweener = player.transform.DOLocalMove(new Vector3(0,100,0), 0.5f, ...
0
votes
2answers
120 views

How do I draw individual pixels in the distance?

Hello everyone I am working with unity3d and I am faced with a task. I have a list of 3D points and I want to draw a pixel for every point on the list that exists after my cameras frustums far-plane. ...
0
votes
0answers
72 views

Unity: How to create tiled sphere?

I want to build a simple random planet generator and thought of using tiles to generate the surface. I googled for hours, but I couldn't find anything helpful. At least all things I found didn't work ...
-1
votes
2answers
108 views

Display text one character by one [closed]

In a game over screen I am trying to display the text "GAME OVER" one character by one. public float letterPause = 0.2f; string message; private TextMesh textComp; public void DeathMenu() { ...
1
vote
1answer
245 views

Get all the gameobjects for a SceneManager scene in Unity

I'm using the new SceneManager to load multiple scenes in the same structure adopting the Additive method. I find it extremely useful but I wonder if there is a way to get all the GameObjects for a ...
0
votes
2answers
132 views

Unity animations - Is the animation component really deprecated?

I was looking for a way to create simple transform animations for 2d objects. As example, I wanted to animate all the objects of the scene when the game is paused (i.e. I just want to move the objects ...
0
votes
0answers
38 views

Importing Fbx single animation, multiple moving parts

I've got a model from Maya which has a ring that rotates 0° - 60° over frames 1-300. I've exported to Fbx and imported into Unity. I can see the animation (Take001) and can trigger it. Everything ...
0
votes
2answers
45 views

How to make transitions between images in canvas (unity)

So I have 3 same images, but with different colors which I want to cycle in my menu. They are only with different hue/saturations and I want them to slowly reduce their alpha 1 by 1 so that the one ...
1
vote
2answers
482 views

Unity: detect animation's end

I need a way to detect if animation's clip finished playing and then execute a certain code. Here's some script, that I wrote (called in Update): if (Input.GetButtonDown ("Fire1") && ...
0
votes
1answer
120 views

Unity Trail Renderer artifacts

I have a projectile prefab that have 2 trail renderers attached to it. Whenever I instantiate another projectile, every trail renderer seems to flicker. This is similar to the question: Changes to one ...
0
votes
1answer
123 views

Rotation around arbitrary vector (using quaternions?)

I currently have a camera which orbits a specific target object, always looking at it. The user can drag the mouse to move the camera left/right/up/down and the camera will move over the surface of a ...
0
votes
0answers
15 views

Displaying a timer ontop of a duplicated gameobject? (Unity2D)

So I have a timer which has for example 30 seconds and when it's over it destroys my gameobject. I can make I wonder how can I take this timer and display it ontop of every one of these gameobjects? ...
0
votes
0answers
163 views

How do I Upload an Image from Unity3D Standalone Game to Twitter?

I'm working on a title that uses some fancy camera based iteraction, and to compliment that, we allow you to take selfie pictures with your image composited along side some of the characters. Our ...
3
votes
2answers
57 views

Stop Unity from smoothening out images

In Unity, low-resolution images are "smoothened out". Is there a way to keep them pixelated? For your information, the images that I'll be using are in PNG format.
0
votes
0answers
20 views

JavaScript — Unity Movement Bug

Hello fellow programmers ! I have been working on a game lately and It's going pretty good. Today I decided to make a new car for it since it's a racing game. When I was modelling the car I ...
0
votes
1answer
31 views

Finding x and z value in the direction of another object

In my game you can drive a car and it has an arrow point to an object you need to drive towards. The arrow pops up above the car using the same x and z value as the car but adding 2 to the y value. ...
0
votes
1answer
44 views

Access to varibles in other attached gameobject script is ambiguous

I'm trying to create reusable scripts that I can drop on my GameObjects. I am currently trying to figure out how to build a projectile script. Ideally, I want to be able drop this scrip on an enemy, ...
1
vote
2answers
840 views

Unity 5.3 Webgl Build not working on Google Chrome

I am testing a game I build it on webgl and opened it on Google Chrome but nothing showed up just a screen with unity logo and no loading screen, then I tried on Firefox and it ran smoothly without ...
0
votes
0answers
45 views

How to check whether there is an object between 2 points in Unity 2D?

I'm working on a project that should let player draw a line. I want to prevent the line from being drawn if there is an object between the endpoints of the line. I tried to used Physycs2D.castline() ...
0
votes
0answers
103 views

HingeJoint shaking, Unity3D 5

I have player with CharacterController and door with HingeJoint, I also have enemies with NavMeshAgent. When someone gets inside this door, it starts shake, jitter, rotating etc. For player I use this ...
1
vote
1answer
47 views

controll mouse cursor movement speed in unity

Im searching for a way to lower my mouse movement cursor speed and not to let the user move it fast but i dont know how. i searched in internet but could not find something Usefull. thank you for ...
1
vote
1answer
87 views

Tracking small moving targets in Vuforia

I am trying to track up to two small moving objects the size of a small toy car (about 7x4x4 cm / 3x2x2”)  from a 75cm / 2ft distance. I’m aware that the distance/size ratio is about 20, which is off ...
0
votes
0answers
33 views

Unity: how to handle drag and drop (from a gui element to the main game window)

To start with: this is not an inventory system. I did look at their implementation and it is not really applicable to my case. Scenario: I have a piece of land where the player can build various ...
0
votes
1answer
57 views

Rotate object with mouse look script

I would like to rotate an FPS camera slightly upwards during a shot as an effect of recoil, but the problem is that I have a mouse look script as well and I assume it prevents me from achieving the ...
0
votes
1answer
90 views

Unity3D: 'Physics' does not contain a definition for 'Raycast'

I'm a complete beginner in Unity 3D, and I'm following a video training. In the video the instructor uses the following code to open a door using raycast: using UnityEngine; using System.Collections; ...
-1
votes
2answers
272 views

How can I render 2D ropes in Unity?

I'd like to be able to render flexible lines, or ropes, as below: I thought about using a Line Renderer but it doesn't have the flexibility to render arbitrary curves.
0
votes
1answer
75 views

Always operate at Time.timeScale = 1?

How do I make a specific script always operate at Time.timeScale = 1 no matter what? I want it to override even when another script calls Time.timeScale = 0 for example.
1
vote
0answers
74 views

game crash on android phone while using unity UI

I am trying to use an unity UI in my game. Initially I Created Canvas with all settings what I need then I compiled it on my phone its working perfectly. Inside the Canvas if I created any button or ...
0
votes
1answer
85 views

Enemy shake/vibrate when following character

I am using the arongranberg A* path finding project to create way points for one enemy to follow the player. However, the enemy vibrates back and forward by about 0.1 - 0.2 unit distance when moving. ...
0
votes
1answer
45 views

Setting up sequential animation clips in Unity

I'm trying to play two animation clips sequentially using Unity 2D. I've been using Mecanim for this so I've imported the two clips in a newly created controller and connected the first one to the ...