Quantcast
Browsing all 91 articles
Browse latest View live

Answer by AyAMrau

Despite this being part of unity examples in docs, using Time.time in lerp is incorrect. The answer here should make everything clear:...

View Article


Answer by AyAMrau

Since the timescale is 0, the animations can't play on their own [Check this thread for possible solutions][1] [1]: http://forum.unity3d.com/threads/playing-animation-w-time-timescale-0.88579/

View Article


Answer by AyAMrau

The value submitted by input field is a string (regardless of validation), so you need to convert the value. [Single.TryParse documentation should help][1] [1]:...

View Article

Answer by AyAMrau

It's Time.deltaTime And you didn't declare a speed variable [http://en.m.wikibooks.org/wiki/C_Sharp_for_Beginners/Variables][1] [1]: http://en.m.wikibooks.org/wiki/C_Sharp_for_Beginners/Variables

View Article

Answer by AyAMrau

I think in the line progressBar.transform.localScale = new Vector3(LoadProgress, progressBar.transform.localScale.y, progressBar.transform.localScale.z); You meant to use loadProgress Since this is the...

View Article


Answer by AyAMrau

Don't assigning the new instance to the projectilePrefab variable. Make a separate variable for the spawned object and assign to that.

View Article

Answer by AyAMrau

Calling GetComponent will get the text field assigned to the same game object as the script. You need to get a reference to the object holding the text field. Either make a variable that can be...

View Article

Answer by AyAMrau

You never set the canBuild variable to false, so if the player touched the building once it will stay selected for upgrade. In OnTriggerExit add canBuild = false;

View Article


Answer by AyAMrau

You need to take the variable out of the function, and declare it as class variable: #pragma strict var counter: int = 0; function OnGUI () { GUI.Box (Rect (20,20,100,90), "Hold IT"); if...

View Article


Answer by AyAMrau

Here is an example code for simply replacing the image to another one assigned in editor, but you can obviously get it some other way. using UnityEngine; using UnityEngine.UI; public class...

View Article

Answer by AyAMrau

When using List(t).Insert(int index, T item), the first argument is supposed to be an index to insert the element at, but it has to fit within the current size of the list. The value you use must be...

View Article

Answer by AyAMrau

You either make a script that has a GameObject field (or a component that is on the prefab) exposed in the inspector and manually assign the prefab (from the Project tab) in the editor. A more dynamic...

View Article

Answer by AyAMrau

I think you could put delegates into use here, [take a look at this question and the accepted answer][1]. [1]: http://answers.unity3d.com/questions/786865/can-you-check-a-boolean-in-a-coroutine.html

View Article


Answer by AyAMrau

The button component has a Transition property, you can set that to Animation and use it to trigger states in an Animator state machine. [The tutorial video explains how to set this up in editor][1]...

View Article

Answer by AyAMrau

I'm just going to make some assumptions here; Since you said in the other post about this, that you tried my version with lambda expressions and that you always got the last button being called, my...

View Article


Answer by AyAMrau

Yes, it's possible. Once you created the scroll structure all you need to be doing is adding the created objects as children of the object, which the ScrollRect points to as Content. [SerializeField]...

View Article

Answer by AyAMrau

the third argument of lerp represents the progress between the two values. What you are doing here is supply the same value on every frame (very small value as well) so there will be no progress. What...

View Article


Answer by AyAMrau

public var winlevel : int = 1; public var loselevel : int = 1; is not valid c# change according to this pattern: [access modifier] [ variable type] [variable name] = [value]; public int winlevel = 1;

View Article

Answer by AyAMrau

UI elements are components just like most things you use in unity, so just call AddComponent(): Text text = gameObject.AddComponent(); text.text = "Hello";

View Article

Answer by AyAMrau

Just multiply Vector3.left * Time.deltaTime by another value.

View Article
Browsing all 91 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>