Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Play sound at capsule location not camera

I have a level where the player watches animations that are across the hall from each other. However because the sound is played at the camera location the wrong sound is playing. I want the ambient sound to be played based on the location of the player mesh or capsule instead of the camera. Is there a way to do this?

Product Version: UE 4.10
more ▼

asked Feb 15 '16 at 11:22 PM in Using UE4

avatar image

1 2 1

avatar image BorisWillis Feb 26 '16 at 05:46 AM

Anyone else have this issue?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I picked up the answer at this forum post: https://forums.unrealengine.com/showthread.php?28170-Sound-Pickup-Based-On-Pawn-Not-Camera

Basically, it can be done in C++ as it is not exposed in Blueprints. You must override the virtual function GetAudioListenerPosition()

My own implementation goes like this:

 void ADialoguesPlayerController::GetAudioListenerPosition(FVector & OutLocation, FVector & OutFrontDir, FVector & OutRightDir)
     OutLocation = GetPawn()->GetActorLocation();
     OutFrontDir = GetPawn()->GetActorForwardVector();
     OutRightDir = GetPawn()->GetActorRightVector();

more ▼

answered Mar 29 '16 at 03:54 AM

avatar image

276 32 35 54

avatar image BorisWillis Apr 01 '16 at 12:59 AM

Thank you so much!! I am working on learning C++ but like many non programmers I am stuck with Blueprint until I learn more about how to implement code.

avatar image BorisWillis Dec 01 '16 at 09:04 PM

I figured out where to find the code and replaced it with the code above in Visual Studio and saved it. I didn't get any errors but not sure if I compiled or even needed to compile. I restarted the project. However, it still didn't update where the sound is played. I don't have a dialogue player just have a volume inside a room. Any advice?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question