Weapon Swap Script
Hi there! Right now I've got a Script that consists mainly of an Array in which I plan to store all my Weapons. What I'm trying to do is to let the player swap between all weapons in the Array, just by...
View ArticleonGUI style silly problem
Hi there! Ok so, this is really a basic question, I don't know what I did wrong here: I followed Unity's Doc Tutorials and a couple on youtube, difference is they get things done, I don't! In my first...
View ArticlePixel Perfect Collision 2d
Hi there! I used to program in flash with as3 and I remember there was this awesome script originally made by Troy Gilbert, I think, that improved drastically flash's collisions. Ofcourse I'm not smart...
View ArticleFooling Rate Of Fire C#
Hi again! I'm trying to prevent my player from shooting as fast as he can press the Space Key. I'm programming in C# right now and I find Coroutines a little bit too complex to handle. Instead, what I...
View ArticleCan't Understand GetComponent C#
Hi there. I realize it's my fault here, because I'm just too dummy to understand how it works from the tons of examples everybody can easily find here or in other sites. How do I use GetComponent? I've...
View ArticleWhat do you think of this? List, Vector 3 and Update
Hi there! I know, my question may sound too much generic, let me rush to the point... Here's what I've got: using UnityEngine; using System.Collections; using System.Collections.Generic; // this line...
View ArticleHow to apply damage without Raycast
Hi there! Sorry if this question may look inappropriate but I can't find a solution on my own. First let me try to explain you what I'd like to do: I'd like my enemy to decrease its life of an amount...
View ArticleFlip a Texture?
Hi there! Allow me to ask you another newbie question please... In photoshop I flip a 2d image like this: edit -> transform -> flip; how would I do that in Unity? I mean WITH code. See, I did...
View ArticleHow To Use Slerp
Hi there! In the past days I've tried to keep my private doubts to myself but now I just have to ask you: WHAT is Slerp and HOW does it works? I've read through many of the questions about it here on...
View ArticleYield until animation is over?
Hi there! I'm editing this question for the very last time, to better depict you with my problem, what I'd wanted to do and how I managed to solve it. The problem I had was very specific: **I wanted to...
View ArticleChoose color/palette swap?
**Hi pals!** I've been wandering throughout a lot of links and webpages all talking almost about what I'd like to do, but I couldn't understand none of them. As usual, not only I admit my knowledge of...
View ArticleDrunkard Walk Algorithm C# Question
Hi dear Unity's community! I've been away for a lot, but I spent that time trying and studying by myself the mysterious world of coding, lurking here and there, reading your kind answers to questions...
View ArticleReference an Instance of an Object?C#
Hi there! I've got a question about a specific problem related to a topic which seems to be hard to understand. That topic is .GetComponent<>(); The question may sound silly but before I got...
View ArticleMistake in Function with Collision and AddForce
Hi people! I'm trying to make this function work and I've spotted an error I can't seem to understand. What this is supposed to do is to make the head of a rope ( which the player can instantiate) act...
View ArticleReference Specific Sprites from Atlas
Hi guys! I know it's already been asked but, instead of helping me, the replies given to this kind of questions have confused me even more! So, I've got an Atlas sliced and inside it I've got some...
View ArticleRaycastHit.distance Values
Hi there! I've got a question that *seems* to be uncovered. The docs are straightforward in defining what is a RaycastHit.distance, but they don't mention a thing about the values that distance can...
View ArticlePhysics.CheckBox() Alternatives
Hi there! I know it's been asked in the forums at least twice, [here][1] and [here][2], but I'm feeling that this *issue* hasn't really been solved in a plain way... care to help? :) The thing that's...
View ArticleRect with Z instead of Y or similar alternatives
*Hi there! I'm editing this question...* I came to understand that the Rect class has a very valuable Function called Contains, which I'd like to use. My problem is that the matrix I use to build those...
View Articletransform.Translate but Transform has Rotation!=0
Hi there! I was testing enemies movements in my wannabe game, and I've noticed a behaviour that I really don't like. Basically, I got a simple translation function that should move the enemies to a...
View ArticleCheck if Exists and if so, Add it to Other List
Hi there! I've just experienced an odd issue and I'd like to be enlightened on this topic. I'm posting a piece of code in which I'm inside a switch, but that's not so important; what matters is that **...
View ArticleUnity UI image + mask has jaggies
Hi there! The new layout for GUI in Unity is amazing **BUT**, as I was playing around with it, I've found out that one of my canvas' images is rendered with jaggies and I know it shouldn't have them....
View ArticleUI RectTransform Position && Screen Resolution
Hi there! I've noticed that the cloned UI images that I instantiate at runtime are misplaced. ***Here's what I have*** I've got Prefabs that are instantiated via script at runtime at a specific...
View ArticleStateMachineBehaviour + StartCoroutine()
Hi there! I'd like to know, if it's possible, how to StartCoroutine() inside a StateMachineBehaviour script. I've tried the following: IEnumerator WaitSomeThenResetStuff (Animator anim){ yield return...
View Article" Binary Save" Stuff - Workaround for Vector3 Serialization
Hi there! I'm editing my original question because I was just looking at the tip of the iceberg and thus formulated a too much open/broad/generic question two days ago. I'm using procedural generation...
View ArticleCursor " Hide" is not Immediate, what's wrong?
Hi pals! I was browsing Scripting APIs to find the method to hide the mouse cursor/pointer, and found the deprecated one with Screen. A note pointed me to the updated method, which is Cursor.visible =...
View ArticleUsing Animator, How To Play an Animation Backwards
Hi there! My question is simple: - I've tried setting the Animator's speed to -1 and failed; - I've tried setting Animation's speed to -1 and found out Animation has no speed parameter; - I've tried to...
View ArticleUnity Build nullReference, but editor sees through it!
Hi there, sorry to bother but this kind of errors are new to me because I've been coding mainly inside the editor! It seems that 1 line in my Awake() returns != null when in editor, and == null once...
View ArticleStandalone build fails Application.LoadLevel() and Freezes
Hi there again! I've tracked down another bug of a line that worked fine in editor and, for some reason, it does it wrong in the build. Here's the chunk of code from the scene named...
View ArticleStatic classes and references are bad for Builds... Alternatives?
Hi there! Yeah... that sucks... I've just found out that most of the problems I've been experiencing lately with my builds are related to static classes and references. Well, static classes most often...
View ArticleMore True Randomess - RNGCryptoServiceProvider explanation required
Hay there, it's been a while but now I have a new Question!!! :D I wrote some code that needed randomness and then checked the results "UnityEngine.Random()" was returning . I didn't liked the way it...
View Article