I have a map varible, witch contains Integer (as type A) and Actor Reference (as type B). The problem is that I need to clear this variable in some point of my code, but it simply does not work. Remove particular key is also doing nothing.
I also found that it works fine with map variable “Integer:String” or “Float:Vector”.
So the question is wheter it’s a bug or is it simply not posible to clear “Integer:Actor Reference” map variable. Thanks.
Just tested it and it works exactly as advertised. As demonstrated above, removing and/or replacing the key with a null object reference produced the effect you described. More in-depth:
Indeed, I can solve that problem with replacing all existing keys in map with null actor ref. Thats probably not the way it should be done, but it works.
Btw Remove or Clear still doesnt work. I found out that if you print lenght of map it will give you “0” and you might think that it actually did cleared map, but in fact it doesnt, you can tell that by printing the actor name at its key (screen attached). So if you try to get data from key, that suppose to give you no data (witch I’m trying to do), it actually will give you that “not-actually-cleared” data.
"Currently, Map values are immutable, which means that they cannot be modified after they have been created. "
As I understand, it is read only for Keys at last. I tried many tricky ways, like a removing whole key and update Values then add it again, but it partially works - I have random results, generally errors.
For now I think maps works only as pre defined variables and update it is on your risk. I hope I’m wrong and I would be happy to find somewhere proof that you can update maps - keys and values, I hope I just have limited skills for it.