Hi. UObjects can’t be copied via their constructors. To store UObjects inside arrays or maps you have use either pointers (USoundWave*) or weak references (TWeakObjectPtr). To work right with GC you have to make all pointers to UObjects visible for UE reflection system. It can be achieved by placing TMap into UPROPERTY() when your map is inside an other UObject. If you need to store UObject references insine non-UObject class you can use FGCObject class. Just add this to inheritance list of your class and override
virtual void AddReferencedObjects(FReferenceCollector& Collector) override;
In this function you have to add all UObjects you captured in the class to a Collector object.
If you decided to use TWeakObjectPtr you have no need to deal with GC, but weak references doesn’t prevent UObjects from unloading. When object will be unloaded this reference will became invalid.
I am just putting pointers into the TMap for now.
It works just out of the box without any problems.
Thank you for giving me all these options. I “fear” I will - at a later point - have to come back and try to understand and use some of the knowledge you gave me there.