jsprenkle
(jsprenkle)
May 28, 2025, 10:51pm
1
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
nande
(nande)
May 29, 2025, 3:18am
2
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
nande
(nande)
May 29, 2025, 3:32am
4
read the docs on fname they are pretty nice.
all good, good luck
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.
nande
(nande)
May 29, 2025, 9:53pm
6
try this
TMap<FName, TArray<TobjectPtr<AActor>>