Hello! Asking this to reframe my thinking; since the entire AudioSource component for the rocket is “redirected” to audioSource, all sound coming from the rocket should cut when audioSource.Stop() is used, shouldn’t it? From the following code, it looks to me like I shouldn’t hear ANYTHING from the rocket when space bar isn’t pressed:
void RespondtoThrustInput() {
if(Input.GetKey(KeyCode.Space)) {
Thrust();
}
else {
audioSource.Stop();
}
}
void Thrust() {
float thrustThisFrame = mainThrust * Time.deltaTime;
rigidBody.AddRelativeForce(Vector3.up * thrustThisFrame);
if(!audioSource.isPlaying) {
audioSource.PlayOneShot(mainEngine);
}
}
…and yet I hear the victory and defeat sounds when not holding space bar. How exactly does audioSource.Stop() function? Thank you for your time!