Play Sound
Unreal
void AGameActor::PlaySoundEffect() {
USoundBase* theSoundFX;
class UGameplayStatics::PlaySoundAtLocation(this, theSoundFX, GetActorLocation());//#include "Sound/SoundBase.h"
}
Unity
void AGameActor::PlaySoundEffect() {
AudioSource* theSoundFX = GetComponent<AudioSource>();//audioSource.PlayOneShot(audioClip, 0.7f);
theSoundFX.Play();
}
Comments
Post a Comment