Choose from 2 audio Sources
Hello, i have an object with the audio source component twice. How can I choose what of the two to play? I tried using this, but it doesn't work audio.Play("Name");
View ArticleMouse click is detected twice
I'm trying to detect two different mouse click but only a single mouse click is detected twice, I don't know whats wrong with the code but I can't detect two separate mouse clicks bool click = true;...
View ArticlePress a key twice
Hi all, Today I've got another problem: I'd like to do a double dash in mid air if (Input.GetKey(KeyCode.RightArrow)) { transform.Translate(Vector3(1, 0, 0) * Time.deltaTime * walkspeed); if...
View ArticleCode executed twice
Hey guys, I need some help tracking a bug in my script. What I'm trying to do is to Instantiate an object in the scene after a delay of 3 seconds. The code works as it is, but sometimes the code...
View ArticleWhy are both seperate scripts being called together?
I have a script named weapon (default weapon of fists) attached to my fists object so that my fists can do a certain amount of damage and execute certain kinds of fist animations/sounds. Then I made a...
View ArticleHow can i reset unity to default?
Hello, i was messing with unity learning the program and i installed some assets from the store and when i went to install fpscontrol to see what it was all about it messed my unity up big time. i then...
View ArticleMecanim when call setTrigger, plays next clip twice
I am working on a simple 2D matching game. The facedown state is a simple animation that is 1 second long and loops. The idle state is for the card when it is face up. A 2 second animation loop plays...
View ArticleUnity Building Game Glitch
Hi i was making my game in the unity editor and when i played it in the editor it was fine it was all working but when i go to build my game for mac i make it to the tittle screen fine but when i click...
View ArticleAfter installing the .APK I see the app icon twice
So, I have this pretty peculiar issue. I create an apk with Unity and then install that APK with ADB and it installs just fine. After installation, I go to check the application list on the...
View Articlecheck if spacebar was pressed two times
yo guys how to count how many times i pressed the 'space bar' like : check if space bar was pressed two times then DO SOMETHING. thanks.
View ArticleAnimator Trigger Parameter Play Twice When Changing State(Animated GIF)
Hi Guys, I'm making a weapon stance and it works but there is a problem... ---------- ![alt text][1] [1]: http://oi62.tinypic.com/21l7jo2.jpg ---------- As you can see the animation "idleA" is playing...
View ArticleGetComponent Variable Referenced Twice
I'm making a fighting game that uses three main scripts per character. There's the stats, control, and projectile scripts. The stats and control both go within the character while the projectile script...
View ArticleCode behaves unexpectedly when not in FixedUpdate
Hi, my problem is that part of my code behaves in a strange way sometimes, not as logically would expect from reading the code. After a bit of messing with the code I tried using a fixed update instead...
View ArticleUnity new GUI, how to nicely trigger grouped toggleButton callback
Hi, I have issues when connecting a function into *On Value Changed* callback : I have a **Panel**, with a **"Toggle Group"** component, which contains two **toggleButtons**, that work exclusively. In...
View ArticleInt increased twice and not only once
Hi, I have a scoreboard in my simple football game, and i want to increase team's score by 1 when the ball passes the goal line. But when it goes in the cage, the score increases by 2, like 0-0 to...
View ArticleJson Deserialize
Hello everyone, I have project which uses Json data, I try deserialize a Json data like this :...
View ArticleWhy a texture always consume twice RAM when running?
I make a simple scene to clarify this problem. 1) import a 2048x2048 RGB 24bit texture, no mipmap. ![alt text][2] 2) create a new scene, then create a plane assigning a diffuse mat with this texture....
View ArticleGetButtonDown() execusting twice
Here is the part of the code that is behaving abnormally: void GetGrabbed(RaycastHit playerHit, Vector3 direction) { if (moveState == "Down" && Input.GetButtonDown("Action1")) { print("Hi");...
View ArticleMethod runs twice, but isn't called twice and isn't subscribed twice
Method **foo()** is running twice and messing things up - I have ruled out the following potential causes: - Multiple instances of the script in the scene (with the ref: search of the scene hierarchy)...
View Article1st Problem: OnLevelWasLoaded, method is getting called twice. 2nd: Loading...
First Problem: As the title states, the method is getting called twice. I have a scene, which have 2 doors. These doors have a script attached to them which has the OnLevelWasLoaded. When I enter this...
View ArticleHow to quit game on double pressing back button?
I am trying to quit my game after pressing back button but its not working. Here is my code: public Canvas quitMenu; public Button startText; // Use this for initialization void Start () { quitMenu =...
View ArticleInstantiating two prefabs instead one how to fix it?
Well hello Guys back with another problem. Im making some grenade throw thing but instead of one grenade but two grenades.. How to fix that. Here's my script. public class GrenadeThrow1 : MonoBehaviour...
View ArticleOnCollisionEnter2D being called twice
I need to calculate a "hit" during every collision. To avoid counting a hit with the same object twice, I check for the Instance ID. The problem is that the collision seems to be happening twice, even...
View ArticleFunction called twice, problem, callback
So I'm trying to make Multiplayer game for the first time. My game is like a Star Wars Space Fight using x wings, they shoot 4 blast or lasers when I press "space", each laser takes off 1 point of the...
View ArticleTrying to pickup an item via trigger, character has 2 collision boxes which...
I'm sure this question has been asked multiple times but I can't for the life of me word it correctly to find exactly what I need all of them seem to be related to other things. I have a pickup object...
View ArticleMy score gets incremented a lot of times
Hello! I have been working on a 2d game and I implemented a score system for some reasons my total score is way more **For Example: My last total score was 7 and I just got a score of 2, The total...
View Article