Download

PlaySoundOnActor does not work

I was wondering if PlaySoundOnActor is still in use in 4.12.Because the compiler keeps saying AActor does not have this member.
2dbabda9b3523a0f31c59ab84f74f1528a4b33f5.png

I’m not sure how to answer your question (as I’m just starting out with C++ in UE4) but this might help: https://answers.unrealengine.com/questions/375039/how-to-playsoundonactor-in-41.html

Thank you very much! It does help.

Hello,
I tried this one and it works fine

#include “Kismet/GameplayStatics.h”

UGameplayStatics::PlaySoundAtLocation(this, MySound, GetActorLocation());

I hope it helps

@youssefmyh I sure hope it helps the guy who made the post in 2016, and was last seen online in 2019.