Adding the file location of a sound to a Sound Base?
How do I attach the address/file location of a sound file directly to a Sound Base?
Right now, I have a declaration of a Sound Base object with a UPROPERTY EditAnywhere tag in my .h file and then the call the sound effect in my .cpp file.
It works! -- after I launch the game and add the sound effect to the component file. When I stop the game, the file is no longer associated and I have to re-assign it every time.
How do I hard code this location? I'm not seeing anything in the documentation.
I found a post that recommended I add an additional Sound Cue object and link it:
This crashes the editor on execution.
asked Dec 02 '18 at 08:43 PM in C++ Programming
If you would look in to the logs (Saved/Logs in project directory) you would get immediate answer ;] ConstructorHelpers functions as name suggests work only in class constructor and this is where you should do this, otherwise it will crash the engine and it should inform you that this should not be used in elsewhere in constructor inside the logs. It needs to be in constructor in order to hard code default asset in to CDO without need for pointed asset to be loaded.
The runtime code errors (at least once that engine is programmed to detect) either prints out errors in log or crash engine (via assetion system https://en.wikipedia.org/wiki/Assertion_(software_development)) and prints out failed condition, sometimes with full error message sometimes also hinting solution. So every time you have crash, your first action should be checking log, it will save you a lot of time.
Follow this question
Once you sign in you will be able to subscribe for any updates here