How can I use TMap for Inventory?
I was planning on implementing an abstract inventory class using a TMap to store items with their associated locations within the inventory, and expose them as readonly properties to blueprints. However, after adding the following UPROPERTY tag, it seems that I can't use TMaps as properties:
The type would be something like this:
Is there any way to use a hashmap like this and expose it to a blueprint? I know I can implement it using a TArray, but not without creating a separate structure that stores an item's locations within the inventory. And using a TArray seems kind of like a roundabout way of doing this.
Thanks for any tips!
You can't expose TMap directly to blueprints as UPROPERTY. The same goes for TSet.
To work around it, you can create UFUNCTIONS for indirect use of your property in bluepeinrs.
answered May 25 '14 at 08:36 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here