Assigning SoundCue defined in C++ in blueprint property

I’ve added

 PROPERTY( EditDefaultsOnly, Category = Audio ) 
 TSubclassOf<USoundCue> sound;

to my blueprint class. I’m attempting to assign a SoundCue which I’ve created in the editor but nothing is showing up when attempting to assign it via the blueprint in the drop down menu. I’ve done a fair amount of research and cannot see any reason why it shouldn’t, this works with any other ‘U’ class type.

UPROPERTY(EditDefaultsOnly, Category=Damage)
TSubclassOf DamageType;

Is the proper way to declare it. Not sure if you missed that or not.

But you could always try this:

  • UGameplayStatics::PlaySound2D(UObject* WorldContextObject, class USoundBase* Sound, float VolumeMultiplier, float PitchMultiplier, float StartTime)

Docs for AudioComponent: AudioComponent

I’ve edited my original question, the formatting didn’t come out correctly. I’m aware of how to declare UPROPERTY types.

The variable appears in the editor as it should as a USoundCue in the blueprint, but I’m unable to assign any Sound Cue which exist in my project to it. This is odd because I’ve assigned many other instances of other classes via blueprint before and have never run into issues of the files not being found in editor.

Before I can use PlaySound2D I need an actual USoundBase to pass into the function. This is where I’m getting stuck because I’m unable to assign an existing Sound Cue in editor to my exposed variable in blueprint.

Changing

PROPERTY( EditDefaultsOnly, Category = Audio ) 
TSubclassOf<USoundCue> sound;

to

PROPERTY( EditDefaultsOnly, Category = Audio ) 
USoundCue* sound;

solved this.