void Start() { //Need to recognize player body rb = GetComponent <Rigidbody>(); //Start setting player data player_health = 100; player_name = "Player"; score = 0; //Get your audiosource to play sound PlayerSound = GetComponent <AudioSource>(); weaponInRange = false; gunTran = GetComponentInChildren <GunTransitions>(); GM = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>(); UI = GameObject.FindGameObjectWithTag("UI"); Markable = GameObject.FindGameObjectsWithTag("markable"); for (int i = 0; i < Markable.Length; i++) { col = Markable[i].GetComponent <Collider>(); } }
void Start() { rb = GetComponent <Rigidbody>(); health = 0; armor = 0; score = 0; name = "Player"; weaponInRange = false; gunOffset = new Vector3(rb.transform.position.x - .05f, rb.transform.position.y - .5f, rb.transform.position.z + 2f); //Delete this later gunTran = GetComponentInChildren <GunTransitions>(); GM = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>(); }