I am trying to code the footstep audio system for my game and I am going to use a struct to contain the sound cues and particle effects for the feet. How exactly do I make a struct that contains sound cues?
Hi ZackReganSounds
It is quite easy to produce this.
-
Add the include for the sound cue object to the header file: #include “Sound/SoundCue.h”
-
Create your struct above your class (or in a library)
USTRUCT(BlueprintType)
struct FAudioData
{
GENERATED_BODY()
public:UPROPERTY(BlueprintReadWrite, EditAnywhere) USoundCue* soundCueRef;
};
-
Create a variable to store your struct within your class
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FAudioData audioData; -
You can now access this struct and the variable inside blueprints and C++
Hope this helps.
Alex