When it is executed (“Play” inside the editor) it crashes with:
Fatal error: [File:D:\Build\++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3233] FObjectFinders can't be used outside of constructors to find SoundWave'/Game/UI/Sounds/Menu/MenuButtonClicked.MenuButtonClicked'
which is exactly the above line.
Any ideas? Perhaps I have to have certain macros in the class header or something like that?
I’m sorry, it was a fair while ago I set this up, so I just had to go and check where the sound was used. I currently have this code to play a 2D sound (though the commented out line should create a 3D sound effect ) using FireSound:
Now I have to find out how to play a SoundWave or - better - how to convert a SoundWave to a FSlateSound to know if I really loaded that asset.
It would just be nice to be able to use the normally used method. Or at least to know why it crashes. Makes me think something is really wrong here with my code.