I’m trying to play a sound when a sphere touchs the ground and I got this script:
#pragma strict
@RequireComponent(AudioSource)
public var collide;
var audios;
function Start() {
audios = GetComponent.<AudioSource>();
}
function OnCollisionEnter() {
audios.Play(collide, 0.7F);
}
But when I try to run it, the compiler gives me this error:
Assets/Collide Sound.js(10,16): BCE0019: 'Play' is not a member of 'Object'.
What should I do to fix it OR if I’m doing it wrong, how can I make the ball have a “bounce sound”?