private void OnTriggerEnter(Collider other) { if (other.tag == "Player" && !onSomeone) { person = other.gameObject.GetComponentInParent <ScriptPerson>(); person.DisplayInfo("Press T"); } }
public void Take(ScriptPerson player) { onSomeone = true; player.weapon = this; transform.SetParent(player.positionWeapon.transform); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(Vector3.zero); body.isKinematic = true; if (!explanationForShoot) { player.DisplayInfo("Left click to shoot", 3); explanationForShoot = true; } }