Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
-2
votes
1answer
421 views

Stacking cubes on top of each other [closed]

How can I stack cubes on top of each other? I dont want to know the code of it just how can it be done? Imaging putting cubes on top of each other in a 3d world with the cube being freely moved in all ...
-2
votes
1answer
304 views

How can i add to a List<Bitmap> also strings? [closed]

In the top i have: private Dictionary<String, List<Point>> pointsList; private List<Bitmap> Scales = new List<Bitmap>(); Then in the ...
-2
votes
1answer
371 views

'NullReferenceException: Object reference not set to an instance of an object' when similar code works

I am getting an error when accessing a function from VirtualRotationStick, despite the fact that a similar VirtualJoystick works ...
-2
votes
1answer
2k views

Audio Source object reference not set to instance of an object in Unity.

I have the following script: ...
-2
votes
1answer
2k views

Record voice and play in unity?

i wanted to ask that does unity3d support audio record and playback option and if it does, how is it possible to just speak and the application will record the sound and play it back after a little ...
-2
votes
1answer
40 views

Random copies of an object?

If I press C<\kbd>, several copies of a prefab show up in the scene. However, my script only creates one. I need to make a random copies, like between 1 to 5. How do I do this? ...
-2
votes
1answer
6k views

How do I load scene using scene manager build index in the build setting unity3d

I only got one scene to load when the timer reaches zero; I need one more scene to load. The scene manager builder index is not working for me. I have tried ...
-2
votes
1answer
2k views

How to make a game object rotate around its Axis in Unity? [duplicate]

Ok So i making this simple platformer with a ball. So basically i have A pickup / Collectible that is a Coin. I want the coin till it gets collected by the ball to keep rotating around it axis . Also ...
-2
votes
2answers
4k views

How solve 400 Bad Request error in unity? [closed]

400 Bad Request UnityEngine.Debug:Log(Object) FBScript:DisplayUserName(IResult) (at Assets/Script/FBScript.cs:63) Facebook.Unity.c__Iterator1:MoveNext() (at Assets/FacebookSDK/SDK/Scripts/Utils/...
-2
votes
1answer
74 views

How to make my “first person controller” continue to turn left or right when key is pressed in Unity 5?

I recently posted this How To Make My First Person Controller turn left and right in unity 5 but now I'm having a slight problem when I press the key that turns my camera it only does it for a little ...
-2
votes
2answers
216 views

Publishing a Unity game to Android/iPhone

How can I publish a game that I made in Unity onto Android and iPhone? How do I generate the Android/iPhone binaries?
-2
votes
1answer
66 views

Where to put the script? [closed]

I watch this video https://www.youtube.com/watch?v=Uhnh8zj_VPo and my question is where to put the script? I'm a complete noob here but I've at least build a map and moving player character. Yes, ...
-2
votes
2answers
169 views

FixedJoint error in Unity?

I get the following error every time I run the code: error CS0120: An object reference is required to access non-static member `UnityEngine.Joint.breakForce' ...
-2
votes
1answer
207 views

Unity5 I lost my codes inside .cs file. C# files still exist, but codes gone

Unity 5.1.2f1 (64-bit) version.(windows 8.1) I closed Unity. After a while ago I opened Unity and I had some errors in Console.Then I clicked the error and I realized that I lost my code in some of my ...
-2
votes
1answer
831 views

How do I have a player also be a server? [Unity 2d]

I'm trying to make a game in Unity 2D, and I need a player to be a host because I can't afford dedicated hosting. Each client will have files that the server (and other clients) need to be able to ...
-2
votes
2answers
5k 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: ...
-2
votes
1answer
410 views

Script to change size of a cube when pressing a button [closed]

I am very new to coding and very bad at it. In my environnement there is a table, and i would like, after pressing a keyboard button, to make a cube appear. Then, by pressing another button, i would ...
-2
votes
1answer
321 views

Joystick control for camera only works when button pressed

I'm trying to use a controller that has a joystick. I'd like to move the camera when the player moves the joystick. The joystick also has a button. So far I'm only seeing the camera move when the ...
-2
votes
1answer
655 views

if statement is executed even when condition is false [closed]

I've made some code that is triggered when the player is in range of the enemy. Everything was working fine until I tried to implement a condition when the countdown reached zero. I made a method (...
-2
votes
1answer
3k views

How to make healthbar decrease in unity [duplicate]

I want to build a health bar which show's the energy of the player.I have two buttons "PLAY" and "IDLE" to show the animation.when I click on the "PLAY" button the character start running along with ...
-2
votes
1answer
803 views

Energy Bar in Unity [closed]

I want to display a debug message when the progress bar is loaded fully and I have a button "refresh", when I click this it should reload the progress bar. Here is the code I have tried: ...
-2
votes
1answer
458 views

How to know the relative facing angles between two players? [closed]

I want a grappling system similar to Tekken, in which different grapples animations are performed depending on which side of the opponent the player performing the grapple is facing. For example, ...
-2
votes
1answer
1k views

Lerp speed or lerp time [closed]

Am I right about the fact that lerping can be done over a set period of time or at a speed which will continue until the target is reached? How are the formulas for the two? Is it something like ...
-2
votes
1answer
250 views

How to keep a GameObject from dropping?

I am applying the following script to first person object: ...
-2
votes
2answers
244 views

UnityScript generating UnityEngine error

I have the following code set out for a simple animation in Unity: ...
-2
votes
1answer
58 views

Moving a 2D object up & down y axis within certain limits

This was originally written to move a 2D object along the negative x axis. Now I also want to move the same 2D object along the y axis (up and down within certain limit and at different speed than ...
-2
votes
1answer
76 views

Why does my OnTriggerStay method throw a NullPointerException when I access the collider's attachedRigidbody?

I set the trigger void OnTriggerStay(Collider other) { other.attachedRigidbody.AddForce(Vector3.up * 100, ForceMode.Impulse); } But when player walks on, ...
-2
votes
1answer
4k views

How do I display a variable in a UI Text component?

How can I display a variable (say an integer variable) in Unity's UI text? The variable may be a public variable from another script. Can anyone please help me do it (step by step)?
-2
votes
2answers
207 views

Double Click Unity

Have a class, which I am calling from PointerClick(in EventTrigger). Need to recall PointerClick after the first PointerClick((0.2f) seconds later).
-2
votes
1answer
60 views

Disabling a script from another script

I have a script that is attached to many game objects. The script simply makes objects drag-able. I want this script to be disabled until a button is pressed. I have used the below code to ...
-2
votes
1answer
793 views

How do I climb up a ledge

I am currently working on a 3D game in unity. I want my player to be able to grab a ledge, and climb up on it. Please I will like to inform you that I am new to this, so a basic and easy to follow ...
-2
votes
1answer
485 views

How to change the scene in Unity after all enemies have been killed?

I have a script that counts how many enemies are left and changes the scene when there are no more enemies. However, it doesn't work, and I can't find the error. I have a really similar script (it's ...
-2
votes
1answer
54 views

How can I select a sequence of objects by moving mouse in Unity?

I have a board of tiles in my game in Unity and I have to select a sequence of tiles by moving the pressed mouse over the tiles like if I would select letters in a such game like on the screenshot. ...
-2
votes
1answer
175 views

Unity3d - Cannot implicitly convert type `UnityEngine.Ray' to `Ray'

I downloaded the free standard assets from the assets store, now I get alot of errors in my console. e.g. ...
-2
votes
1answer
64 views

dependency between engine and 3d model software. Resolution - what is it really [closed]

I have a few questions about gamedev as a beginner. 1) Why someone tells that Unreal Engine has better graphic then for example Unity? I can create any quality model in 3ds max, for example, and ...
-2
votes
1answer
58 views

Weird behaviour dragging a UI Image [closed]

I'm making a classic card game in Unity. I created the first deck, and when I click on the top card, it is discarded and moved to a second card stack. When the first card stack is empty, then it is ...
-2
votes
1answer
58 views

how do you add W, A, S, D controls to unity 5.5

I have a character already in the game files and just need to know how he can move I have looked online in lots of places and it just doesn't make sense to me as I am sorta new to the game development ...
-2
votes
1answer
484 views

Why I can't change from one scene to another by using SceneManager.LoadScene()?

I made a game with two scenes and everytime I call the function SceneManager.LoadScene(), no matter the value, type(string or <...
-2
votes
1answer
86 views

Comparing Prefabs in a Memory Card Game

I need to compare two cards together to check if the two cards is identical. Currently I have a prefabs folder with 18 images which are duplicated in the same folder, so the total cards is 36. How can ...
-2
votes
1answer
39 views

Changing an objects on through C# script in Unity

I am trying to export my Unity project to Android Studio so that I can create some Android buttons that "controls" the Unity app's behavior. I know what I have to do in order to let it access through ...
-2
votes
1answer
562 views

How to code C# to allow one tap to cause the character to jump for Android device in 3d game

Is there a native unity 5 to implement one tap to have the character to jump.? My game is 3d and I want to tap anywhere once or in the character. I found a MobileTiltController as part of the ...
-2
votes
1answer
869 views

Playerprefs dont work fine!

because it don't work fine! i am pretty sure there is no else problem. also how can i remove playerprefs data in windows? i used Playerprefs.Deleteall(); but it also don't work. is there any problem ...
-2
votes
1answer
51 views

How to assign GUIText from heirarchy into prefab object?

I want to assign GUIText from heirarchy into prefab using that C# code: ...
-2
votes
1answer
26 views

Unity3D: Entering a trigger disables a few bools for no reason

I'm trying to make it so when an object enters a collider with the tag "Down" a single boolean turns false, but the problem is that more than one booleans(canGoUp, canGoLeft, canGoRight) are turning ...
-2
votes
1answer
175 views

Terrain making in unity [closed]

I'm making a minecraft-like game, I'm trying to make a terrain made of cubes, but copying and pasting the same cube takes too much time and uses too much of my pc's RAM. So, any suggestions?
-2
votes
2answers
548 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 ...
-2
votes
2answers
1k views

How can I differentiate 2 triggers in script?

I have two boxcolliders with triggers, and when I use the function OnTriggerEnter, even if I enter the first or the second trigger, it does the same thing. And I want a trigger to do a certain thing ...
-2
votes
1answer
4k views

How can I make a gameObject “stick” to another gameObject after it has collided with it?

How can I make a gameObject "stick" to another gameObject after it has collided with it? Right now the gameObject just passes through! [C#]
-2
votes
1answer
825 views

How to remove this NullReferenceException in Unity

...
-2
votes
1answer
7k views

How to set a background image in Unity?

I am trying to create a game on Unity but I am still learning. I want to make a start menu, and I want to set a background image. Then, I will add "Play" or "Exit" buttons on top of this image. How ...