using UnityEngine;
using System.Collections;
public class CoreHealth : MonoBehaviour {
public int MaxHealth;
public TextMesh CoresGui;
public int health;
public CameraSetter set;
public GameObject particle;
public GameObject Cube;
public GameObject Smoke;
private bool hassmoke = false;
public AudioClip play;
void Awake(){
health = MaxHealth;
}
public void ReceiveDamage(int damage){
health -= damage;
GameObject part = (GameObject)Instantiate (particle, Cube.transform.position, Cube.transform.rotation);
AudioSource.PlayClipAtPoint (play,transform.position,10f); //audio
Destroy (part, 1f);
}
void Update(){
if(set.English == true)
CoresGui.text = "Core Health: " + health + " / " + MaxHealth;
else
CoresGui.text = "Vida do Nucleo: " + health + " / " + MaxHealth;
if (health <= 0)
Application.LoadLevel (2);
if (health == 30 && hassmoke == false) {
Instantiate (Smoke, Cube.transform.position, Cube.transform.rotation);
hassmoke = true;
}
}
}
In this script, when an enemy hits the core, the core loses health, plays and particle and an audio clip. Everything works fine, but the audio is really low. I can’t hear it. Can someone please help?