When I get a weapon from the ground, I want that weapon to enter weapons [0]. but doesnt work
this first gun script
public Transform me;
public static GameObject gun;
public bool distance1;
void Start(){
}
void Update(){
if(Vector3.Distance(transform.position,me.position)< 2.5f){
mesafe1=true;
}
if(distance1 && Input.GetKey(KeyCode.F)){
gun=Grevyard.weapons[0];
}
public Transform me
public static GameObject gun1;
public bool distance1;
void Start(){
}
void Update(){
if(Vector3.Distance(transform.position,me.position)< 2.5f){
distance1=true;
}
if(distance1&& Input.GetKey(KeyCode.F)){
gun1=Grevyard.weapons[1];
public static GameObject[ ] weapons;
private GameObject current;
void Start(){
}
void Update(){
}
void silahlar(){
if(Input.GetKey(KeyCode.Alpha1)){
weapons[0].SetActive(true);
weapons[1].SetActive(false);
current=weapons[1];
}
if(Input.GetKey(KeyCode.Alpha2)){
weapons[0].SetActive(false);
weapons[1].SetActive(true);
current=weapons[2];
}