Answer by TobiasP
First, the variable/method must be **public** To get the a variable or call a method from the parent: Script parentScript = this.transform.parent.GetComponent
View ArticleAnswer by TobiasP
Ok, So I hope you don't get mad, but I changed and added a few things. The way you were doing it wasn't going to work because it will turn off both player's movement controls and other issues. I made...
View ArticleAnswer by TobiasP
This is what I did for missiles following an enemy. // Get the direction we need to rotate towards rotation = Quaternion.LookRotation(target.position - this.transform.position); // Rotate towards the...
View ArticleAnswer by TobiasP
This is a bunch of awesome, free tutorials. [Walker Brothers Studio][1] [1]: http://walkerboystudio.com/html/unity_training___free__.html
View ArticleAnswer by TobiasP
Basically, OnCollisionStay gives information about the impact ( impact velocity, etc ) as where OnTriggerStay simply says, yes, we have had a collision This will help explain them better then I can! =]...
View ArticleAnswer by TobiasP
This is from the Unity Script reference in the docs: Note: Make sure the GameObject you are trying to push has a rigidbody // this script pushes all rigidbodies that the character touches var pushPower...
View ArticleAnswer by TobiasP
If the script is attached to your character use this: renderer.material.color = Color.(choose a colour) Or renderer.material.color = new Color(r,g,b,a); (red, green, blue, alpha)
View ArticleAnswer by TobiasP
Try this: this.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x, this.transform.eulerAngles.y, 0);
View ArticleAnswer by TobiasP
IEnumerator Wait() { while(true) { yield return new WaitForSeconds(1); myInt += 2; } } Just use myInt -= 2; if you want it to go down. Hope this helps!
View ArticleAnswer by TobiasP
First, the variable/method must be **public** To get the a variable or call a method from the parent: Script parentScript = this.transform.parent.GetComponent
View ArticleAnswer by TobiasP
Ok, So I hope you don't get mad, but I changed and added a few things. The way you were doing it wasn't going to work because it will turn off both player's movement controls and other issues. I made...
View ArticleAnswer by TobiasP
This is what I did for missiles following an enemy. // Get the direction we need to rotate towards rotation = Quaternion.LookRotation(target.position - this.transform.position); // Rotate towards the...
View ArticleAnswer by TobiasP
This is a bunch of awesome, free tutorials. [Walker Brothers Studio][1] [1]: http://walkerboystudio.com/html/unity_training___free__.html
View ArticleAnswer by TobiasP
This should work! healthbarWidth = (currentHealth / maxHealth) * healthbarOriginalWidth; I hope the variable names are representative enough! Hope this helps!
View ArticleAnswer by TobiasP
This should get you what you want. [Triangle Prism][1] [1]: http://blog.nobel-joergensen.com/2010/12/25/procedural-generated-mesh-in-unity/
View ArticleAnswer by TobiasP
File - Build Settings: Add your scenes and build! ![alt text][1] [1]: http://i.imgur.com/zvuyxY6.png
View ArticleAnswer by TobiasP
Spawn an Empty GameObject, place it where you want your object to go, then child your object to the Empty GameObjecy. (I had this issue too but I was using a collectable and manually placing it!) Hope...
View ArticleAnswer by TobiasP
It should ignore collision between those two objects if specific conditions are met (look at link). [Reference][1] [1]: http://docs.unity3d.com/Documentation/ScriptReference/Physics.IgnoreCollision.html
View ArticleAnswer by TobiasP
There are multiple ways! GameObject.FindGameObjectWithTag(); GameObject.FindGameObjectOfType<>(); Resources.Load(); The third one you need to make a folder called "Resources". Say you have a...
View ArticleAnswer by TobiasP
Uncheck 3D sound in the sound's options! ![alt text][1] Hope this helps =] [1]: http://i.imgur.com/rB3Rdlu.png
View Article