TMap Problems. 🤔

That might be, because classes need to be marked as blueprint type.

The container / blueprint limitations are a pain in the butt but have always been there and will always be there. it’s a prototyping tool or “fun” ish way for starting developers to learn code. It’s mostly dead to me.

I create 99% of the code in c++ and expose only certain methods to blueprint to use for debugging purposes. If you’re not targeting any blueprint users on the marketplace as customers or anything this is the way to go. You could even create a function library later on to provide an interface for blueprint users to access your c++ stuff, a bit like the UKistmetMathLibrary just uses FMath for most things behind the scenes.

Depends on your needs.

What if you pass around the UObject and cast that to interface instead of passing around TScriptInterface? This is most common. Won’t get rid of the container nesting limitation though. If you don’t need to care about map performance at this point then consider using an array of a struct where the struct contains your ID (FString / GUID) and filter by predicate like I show here:

Having two TMap to access the same instances - #4 by Roy_Wierer.Seda145

1 Like