I am trying to play a sound when the player walks through a trigger volume, but it’s not quite working out.
Here’s what I’ve done:
-
Added an Audio Component to my DefaultPawn (I’d like the audio to sound like it is coming from the players own mind). It’s declared, with a nullptr assigned in the .h file. In the .cpp file I have protected using an if function.
-
Added a Trigger Volume to my scene.
-
Declared it in the .h file.
#include "Engine/TriggerVolume.h"
UPROPERTY(EditAnywhere)
ATriggerVolume* TriggerWelcome;
- When I click on the desired Trigger Volume in the DefaultPawn edit menu, it doesn’t populate the dropdown menu. It just stays as “None” (It does allow me to select the trigger volume when playing the game, via ejecting and repossessing).
My questions:
- Why does it not allow me to select the trigger volume?
- Is there a better way to be doing this?
Thanks,