Questions tagged [unity]

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.

2,953 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
-1
votes
2answers
3k views

Diagonal movement is faster than horizontal or vertical movement. How to fix?

When using Horizontal or Vertical input keys, the the movement is normal. But when trying to move diagonal, multiple keys are to be pressed, and the speed just stacks up. Yes there are many answers ...
-1
votes
1answer
1k views

2D sprite is 'blinking' when animation is playing

When I fire a bullet, instead of frames 4 and 6, the sprite selector in the sprite renderer component says "Missing (Sprite)" and 'blinks' for a frame, not showing anything.
-1
votes
1answer
287 views

How to import the Sanford Midi Library?

I am trying to parse a MIDI file using the Sanford MIDI Toolkit. How do I use this toolkit? I found this link on Github: https://github.com/tebjan/Sanford.Multimedia.Midi I downloaded the .zip file ...
-1
votes
1answer
98 views

How to make a player walk over the network

First of all, it is a newbie question and I am a noob so ya. I am working on Unity with low level network API. I am able to ...
-1
votes
1answer
33 views

How can i compare Input.anyKeyDown to prefab name?

...
-1
votes
1answer
23 views

Unity App for mobile

I'm a newbie here I'm willing to acquire a unity game from a developper and he mentionned that the app is Optimized for Mobile Devices. Does it mean I can build it for android and export the apk file? ...
-1
votes
1answer
48 views

Battle of the Vectors

When building a Unity2d game, is it better to use Vector3's for waypoints, etc... or to use Vector2's ? The advantage I can see of using a Vector2 is that it is smaller (2 floats vs. 3) and therefore ...
-1
votes
1answer
516 views

The value of animation parameter is not changing?

Code: ...
-1
votes
2answers
59 views

Make Float Hindi (Devanagari)?

Whenever the game sessions ends and the Game Over scene is loaded, the score is stored in this float, which is in another script that I do not have on here: ...
-1
votes
1answer
161 views

Problems with arrays

I'm having a problem with the arrays that is in my code, I found the problem,but I don't know where or what lines to fix it. First, I'm setting variables and I dragged the gameobjects and buttons ...
-1
votes
1answer
833 views

Why is my Unity scene prefab auto-changing?

I have some prefabs which are instantiated in game. There are some attributes of prefabs such as size(width, height), text string and color which are changed from code. Well, it is working fine. ...
-1
votes
1answer
43 views

How to see my plane & ball in the camera during play?

At the 13:00 mark of this tutorial, the narrator manages to launch a scene and control the ball (player) in that scene. However, when I launch my scene after following his instructions till then, I ...
-1
votes
1answer
331 views

Find if two triangles are touching each other! To find the edges of a polygon. Unity3d/C#

I need help trying to find if two triangles are touching each other. If vertices are repeated twice in the mesh triangles setup it means they are connected. I then try to calculate the direction ...
-1
votes
1answer
102 views

How do I count with input, in Unity?

How do I count from 1 to 10? I want to count upwards to 10 when I press C, and count down to 0, when I'm not. ...
-1
votes
1answer
3k views

How to assign GameObject to a instantiated prefab?

GameObject A (Panel - CraftSystem) is in the scene already as seen on the screenshot (Screenshot). I then instantiate the GameObject B (WorkingStation) which has a public GameObject craftSystem. So I ...
-1
votes
1answer
2k views

Unity-How to use one scene's camera in another scene?

I have two scenes in my game, one is the menu scene with the UI and the other is the scene where all my game items are. Right now my UI looks too plain so what I want is to display my actual game ...
-1
votes
1answer
145 views

Cannot find Natural front 3D facial animation plugin in Window drop down

I am using Unity version 5.4.2 which is the latest, I tried to go through the tutorial video for creating 3D animations of 2D pictures but I am unable to find the icon of -> Natural front 3D facial ...
-1
votes
1answer
82 views

Incorrect values fron Input.GetAxis

I need the gamepad Input on my game, and I'm trying the Input.getAxis("Horizontal") function and the documentation says that returns a value from -1 to 1, 0 is the central value, when I not move the ...
-1
votes
1answer
62 views

Unity 5 Deleting Large Quantities of GameObjects (around 10000 or more) from Hierarchy

I've screwed up on this one. I used a script to randomly generate trees in my scene. The reason I did this instead of using the Mass Place Trees function in the terrain editor is because the trees all ...
-1
votes
1answer
2k views

How to access the component of a child object inside another child object using a tag?

As the question above, I need to access the collider component of a child object that is inside its parent object which is also a child to its parent object. I tried this line of code below but it ...
-1
votes
1answer
490 views

Can't seem to translate in Y using “Jump” axis

I'm trying to write a character controller for a free-moving camera. I don't want it influenced by physics at all (no gravity, no collisions, no inertia). I've managed to get great movement in the X ...
-1
votes
1answer
84 views

When mouse on a button image appear?

My canvas contains three buttons and three images. I would like the images to appear when the mouse hovers over buttons. ...
-1
votes
1answer
1k views

Correct jumping cycle logic in Unity with 3 jump animations

I have 3 jump animations; jumping up, jumping down, and the loop in between. I want to play them in an order, using logic. When the player presses space, I should play the "jumping up" animation, ...
-1
votes
1answer
326 views

Allow user to load remote assetbundle

How can I change the script to allow the end user to enter a URL, in the game view themselves, instead of me at the back end? Here is the Unity script that I am using successfully to allow me add an ...
-1
votes
1answer
595 views

move camera with button in unity c#

I want to move Main Camera with button. Here's my gameplay: Here's my scene: I want that when I click a button, main camera moves to right in another pic.
-1
votes
1answer
331 views

How do I use Couroutines for spawning and spawn certain amount of enemy AI in the scene?

I have made a spawn function for spawning enemy AIs, and it didn't work well in my scene. I have the enemy AIs spawning in the update function, and it initially works fine, but it's spawning too many ...
-1
votes
1answer
292 views

Coroutine doesn't continue after checking for bool

I have the following coroutine: ...
-1
votes
1answer
111 views

Attack Targetted Enemy Only

I have a perfectly working targetting script and I want to be able to deal damage to my currently selected enemy. I have a targetting script which is below:? ...
-1
votes
2answers
596 views

Unity equivalent to cocos2D (and Sprite Kit) Actions?

Does Unity have an equivalent to the Actions feature/functionality of cocos2D and Sprite Kit; if so, what is it? cocos2D Actions: http://python.cocos2d.org/doc/programming_guide/actions.html http://...
-1
votes
1answer
2k views

Unity AddExplosionForce to a Navmeshagent

I have a NavMesh agent and I would like forces to be applied to it during an explosion. Currently the NavMesh agent isn't interacting with the exploding object. The explosion occurs and agent takes ...
-1
votes
1answer
125 views

Enemy Retargeting

I am trying to make a game using NavMesh agent in Unity, where the enemies first attack the player and change their target to tanks when player spawns them. Then again retarget player after the tank ...
-1
votes
1answer
390 views

Unable to move mouse cursor while pressing keyboard button

I've a player to which I've attached character controller and two scripts - Controller and MouseLooker to control the player ...
-1
votes
1answer
284 views

How to optimize movement script using CharacterController component?

I've made a very basic character controller using a CharacterController component. I'm still a beginner so I keep learning new things. My problem is how to optimize my controller script. Also, I would ...
-1
votes
1answer
104 views

Combining Pause and Start Menu

I got my pause menu working by using this code: ...
-1
votes
1answer
74 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. ...
-1
votes
1answer
618 views

How to avoid mouse click over the trigger object?

I'm detecting mouse clicks if the click is happening over the collider but I don't want to fire mouse clicks if it is on the trigger object. How to I do this? Any suggestions?
-1
votes
2answers
404 views

Why am I having these errors, when opening my Unity project in Ubuntu?

I'm experiencing some trouble with the Linux build of Unity. I suspect that my Nvidia driver is producing this error, but I'm really not sure. I have an Nvidia GTX 860M, and until 2 days ago, I was ...
-1
votes
2answers
137 views

Before I change position I want to check if the gameobjects are collinding

For starters I'm new to Unity3d. So my question is when I click on an object I want to change its position but without collinding with the other objects and I need a function to check that. I already ...
-1
votes
3answers
383 views

A method to create and assign a name to a GameObject (Unity)

I'm trying to create a function that takes in a name of an object in the editor and assigns this accordingly as well as the name of a sprite, rigidbody, etc. Basically what I have so far is- ...
-1
votes
1answer
409 views

Quaternion.Lerp not working properly in Unity3d

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate ...
-1
votes
1answer
91 views

Right-side weapon rotate to face the mouse target

I have a 3D game looking from top to bottom where I move the mouse to aim at targets. I have a simple box (the player) with a sphere on its middle-front (that is the pistol) and a cylinder on its ...
-1
votes
1answer
2k views

Get current position of instantiated prefab

I wrote two little scripts to manage platform spawning. 1st - is attached to the Spawner gameObject. It's uset to spawn new platform. 2nd - is something like Platform Manager which not extend ...
-1
votes
1answer
117 views

Cloning a gameObject which use properties similar to original gameobject

How to make clone of gameobject have the same properties as the original gameobject just placed right to it and the clone should fire exactly parallel to original character. Every property should be ...
-1
votes
1answer
3k views

Unity Ui slider volume control

I have the ui slider to control my volume, I have my slider to control all the volume of the game. I have make it so when the main slider change value all the other slider change with it but when I ...
-1
votes
1answer
269 views

Egg splatter effect

We are working on game where player will throw eggs at each other, I would like to know how can we implement Egg splatter effect after egg hit other player? Thanks.
-1
votes
1answer
802 views

Why is this unity camera moving in weird directions?

I have the following script ...
-1
votes
1answer
79 views

C# Unity3D - How can I use a INT from other classes?

I have 3 Objects Capsule 1, Capsule 2 and Capsule 3. Every Capsule has a script on it for health/damage. It also contains an int for hits and points. Hits should be increased by one for every bullet ...
-1
votes
1answer
675 views

How to draw arrows between bubbles

I have 2 * 3 matrix of bubbles and i want to draw arrows between those bubbles. it should be done in way as in below Image:- 1 ---->2--->3 What is happening here, When i touch 1 bubble, start point ...
-1
votes
1answer
1k views

Marching Cubes Chunks

I'm doing some voxel based game, where I want to have voxel planets. I decided to use the marching cubes algorithm, and I successfully created a planet (even with noise) with the following density ...
-1
votes
1answer
761 views

2D bouncing formula doesn't work properly

I am new to Unity, and I am trying to create a bouncing ball, so I've been researching bouncing related physics and I found a formula: Formula: ...