Answer by brunopava
I solved this. Follow this workflow and you should be fine. 1 - Create a folder on your assets called "StreamingAssets" 2 - Use Application.streamingAssetsPath + "\\" + yourFileName to access the...
View ArticleAnswer by brunopava
Maybe this link will help you: http://www.gamertogamedeveloper.com/gtgd-series-1/ Check out video number 33. It explains exactly how to set up your hamachi connection. And video number 4 explain the...
View ArticleAnswer by brunopava
// I can't quite figure out how your script work, but you could try something like this: //set up the name in the editor public var name:string; public function deactivate(theName:string) { if(name ==...
View ArticleAnswer by brunopava
You could set up triggers around the players so when one enters another's trigger you take an action via the function [OnTriggerEnter()][1] And for the other part you shoud check [Application][2] class...
View ArticleAnswer by brunopava
Screen.lockCursor = true; // disable the cursor Screen.lockCursor = false; // enable the cursor Check out this [Screen][1] class. [1]:...
View ArticleAnswer by brunopava
You should try to put your space ship inside a empty game object with it's Z axis facing towards were you want to go(in that case, right). Then you use iTween path on the new object. Let me know if it...
View ArticleAnswer by brunopava
c# // fast rotation float rotSpeed = 360f; // distance between target and the actual rotating object Vector3 D = target.position - transform.position; // calculate the Quaternion for the rotation...
View ArticleAnswer by brunopava
Make a script like this: function OnTriggerEnter (other : Collider) { if(other.gameObject.tag == "Player") { other.gameObject.SendMessage ("ApplyScore", incomingScoreValue);...
View ArticleAnswer by brunopava
// this line is wrong GameObject.Find("__GameMaster").GetComponent(Score).score)SendMessage("SetScore"), spentAmount); // not sure why are you getting the score, but this should work....
View ArticleAnswer by brunopava
You are using GetComponent wrong. It requires a typeof. Like this: GetComponnent().enabled = false;
View ArticleAnswer by brunopava
The var keyword is used on Javascript, to declare variables with C# you simply state the type of it. //Your code var cw = (GameObject)Instantiate(envCrossSectionCCW.gameObject); //My code GameObject cw...
View ArticleAnswer by brunopava
Hi, I had the same problem once. But looking at the API reference I discovered that angularSpeed receives influence from both speed and acceleration. So I played around and found that if you increase...
View ArticleAnswer by brunopava
There is a cool one here: https://www.assetstore.unity3d.com/en/#!/content/19248
View ArticleAnswer by brunopava
So, in the link below the guy figured it out in an elegant solution that is also re-usable. public static class CoroutineUtilities { public static IEnumerator WaitForRealTime(float delay){ while(true){...
View ArticleAnswer by brunopava
Personaly, I like to make a Singleton and cache some importante variables in it like player, points, list of enemies and etc. The upside is that you make sure that there will be only one instance of...
View ArticleAnswer by brunopava
Also, you need to toggle your boolean to false and true. Like this: public function Toggle() { if(MainMenuON){ // if its active, then deactivate MainMenuON = false; MainMenu.SetActive (false); } else{...
View ArticleAnswer by brunopava
You could use a enum to list the states of your npc. Like: idle, chase, attack Check for the transitions in an Update() function and take the correct action. This aproach is called Finite State Machine...
View ArticleAnswer by brunopava
That is dictated by its radius. If he can fit in the maze it will navigate. Also you need to bake the mesh with the correct radius. ![alt text][1] ![alt text][2] [1]:...
View ArticleAnswer by brunopava
void SeekAndDestroy() { blocks = GameObject.FindGameObjectsWithTag("Buildplace"); if (blocks.Length != 0) { block = blocks [Random.Range (0, blocks.Length)]; rend = block.GetComponent();...
View ArticleAnswer by brunopava
Like this? using UnityEngine; using System.Collections; using System.Collections.Generic; public class VectorIdentificator : MonoBehaviour { //fill this in the editor public List list; private void...
View Article