I do not understand how TMaps are supposed to work… But the TMap won’t keep its keys.
Using this thing gets me really confused, I familiar with C# so maybe I shouldn’t be relating it to the Dictionary but they seem very similar.
I declared my TMap like this in my .h like so
in my .cpp file I have a method that uses the TMap; this is the entire method without the signature.
Essentially this method makes it so we don’t have overlapping Audio playing on the same “layer”. I am using the TMap to keep track of each layer, represented by int32, and the audio currently playing on that layer.
I had a log at the top and bottom of this method that gave me the TMap.Num() so I can see if they were being added because the audio was still overlapping each other.
However I kept getting 0 at the top and 1 on the bottom. Everytime I called this method, but I shouldn’t because nothing actually removes the audio, it stays there until another audio replaces it. So I expect when calling this method again using the same layer it should have something there but it doesn’t.
Why is it that when I add an element in this method it doesn’t persist outside of the scope?