I remeber one of play sound function been been depricated and i had warning to replace it with this one (for some reason can’t find it in API refrence so here you have paste from source code):
UAudioComponent* UGameplayStatics::SpawnSoundAttached(
class USoundBase* Sound,
class USceneComponent* AttachToComponent,
FName AttachPointName,
FVector Location,
FRotator Rotation,
EAttachLocation::Type LocationType,
bool bStopWhenAttachedToDestroyed,
float VolumeMultiplier,
float PitchMultiplier,
float StartTime,
class USoundAttenuation* AttenuationSettings,
class USoundConcurrency* ConcurrencySettings
);
Only 2 first arguments is needed, if you dont know which component to use just do this Actor->GetRootComponent(). It’s a static function so you don’t need object just use UGameplayStatics::. Also note that it creates audio component on your actor which can be reused as it returns it. Generally you should play sounds from audio component in actor, aspecially if it’s same sound all the time.
I guess they removed old function now. Pro tip: if you update to new version you will get warnings during compilation if something is deprecated and will be soon removed, it also usally tells you what you need to so with old function (usally replace with new one), some of those can be simply updated by using project-wide “Find and Replace”, but some require to update each case of use (like this case, as you see it’s way different then it use to be). So update UE4 all the time (you can skip stable releases like x.x.1 etc.) and check those warnings on each update, it best way to always keep your code up to date.