Quantcast
Channel: Answers by "AyAMrau"
Browsing all 91 articles
Browse latest View live
↧

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


Answer by AyAMrau

Yes, each call to StartCoroutine starts a new one, so everything will be executed from the top in the new coroutine, including any variable initialisation.

View Article

Answer by AyAMrau

Yes, basically after you yield, the coroutine will restart on the next line after the yield. In your case it's the last statement in the loop, so it will go back to the condition part of the loop. The...

View Article

Answer by AyAMrau

@Hitjones Even in your first screenshot the Script reference says None, which means there is an issue from the start with the script. It quite possible that the Scriptable object file name and class...

View Article


Answer by AyAMrau

You are not setting the Shoot bool on the animator to false except for when the reload happens. Two solutions depending on design: You want to play the animation once per click (no continuous shooting)...

View Article


Answer by AyAMrau

Object is the base class of all objects unity can reference. If you look through the documentation for other elements, under the name you will see something like Namespace: Inherits from: [Class]. It...

View Article

Answer by AyAMrau

Transform.Find return type is Transform, so you need to access the attached GameObject: weapon.gameObject.SendMessage("Blah", 1.0f, SendMessageOptions.DontRequireReceiver);

View Article

Answer by AyAMrau

In this case the <> signs are used not to mean less than or greater than, but they are a syntax used with generic methods to supply a specific type to be used by the method. [Here's the MSDN page...

View Article

Answer by AyAMrau

To add a script to a game object just use AddComponent: var script : MyScript; script = gameObject.AddComponent (MyScript); Replace MyScript with the name of a script you want to attach.

View Article


Answer by AyAMrau

Instead of constant checking you could use a delegate. In the EnemyDeath script add: public System.Action OnDeath; And then in the same script, at the point where you set the enemyDead to true add:...

View Article

Answer by AyAMrau

When declaring a function you need to specify argument type: public void AdjustcurHealth (int adj)

View Article


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
Browsing all 91 articles
Browse latest View live


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