Implementing a list of actors as a blueprint property

I’m trying to create a list of Actors my module interacts with. What’s the correct way?
I tried this:

UPROPERTY(EditAnywhere, BlueprintReadWrite)
TMultiMap<FString, AActor*> Subscribers;

But get an error:
Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘TMultiMap’

Thanks

just use a TArray

or TMap
i havent used a tmultimap
fstring would be a bit slow for a key, i’d use a fname if i need to.
also i’d use a TObjectPtr instead of AActor*

1 Like

Thanks for the pointers. Being a noob I wasn’t aware of fname. I’ll give those a try

1 Like

read the docs on fname they are pretty nice.
all good, good luck :slight_smile:

pd hint, always use uproperty on uobject pointers variables (components actors etc)

I found out TMultiMap<> is not supported as a blueprint property, but TMap<> is.
Unfortunate, since I need to be able to support multiple subscribers to the same topic.
Hopefully it will be supported in newer engine versions.

try this
TMap<FName, TArray<TobjectPtr<AActor>>