dos anyone know whats wrong with this script
function Update(){
if (OnTriggerEnter())
{
audio.Play();
}
}
dos anyone know whats wrong with this script
function Update(){
if (OnTriggerEnter())
{
audio.Play();
}
}
Take OnTriggerEnter out of Update:
function Update() {
...
}
function OnTriggerEnter() {
audio.Play();
}
OnTriggerEnter is automatically called whenever something enters the trigger, so it doesn’t need to be in Update.
o ok thanks