Сообщение от SGREED
и...
помогите мне тупому, потому что ище не решил эту проблему, как всунуть в этот скрипт воспроизведение звука выстрела [gun5]
пробывал много чего не получалось, по любому я что то не так пишу((
|
var projectile : GameObject;
var fireRate : float = 0.5;
var otherClip: AudioClip;
private var nextFire : float = 0.0;
function Update () {
if (Input.GetButton ("Fire1") && Time.time > nextFire) {
nextFire = Time.time + fireRate;
var clone : GameObject =
Instantiate(projectile, transform.position, transform.rotation) as GameObject;
clone.rigidbody.AddRelativeForce(Vector3.forward*1000f);
audio.clip = otherClip;
audio.Play();
}
}