Get value for key always returns not found when trying to give image sprites metadata

I am making an asteroid destroyer game, and when trying to add health to the asteroids in the form of a dictionary, every time I try to get that value correctly it just returns "not found" all the time. Can anyone help?

Main Blocks:

getMetaData procedure:

It looks like you are overwriting the dictionary data in variable global activeAsteroidMeta each time you set it....

how does that happen?

On second thoughts, it is probably not that but something to do with lists. let me have a look.

Tested it out, and it works OK for me. Check that all the variables that you use are set. Use Do It in companion to debug (you may need to set things to labels or variables to test)

AsteroidDestroyer.aia (372.1 KB)

here is my .aia file, see if you can figure out why it is not grabbing the value of the key

I cannot see any reason why it doesn't work. You may have to carefully debug / disassemble to find the cause. Note: you have a red cross where you call the notifier (item).

@vegetable: These are the core blocks according to your problem:

You always get "not found". In the procedure "getAsteroidMeta" a component is required. If it matches "getValue" of dictionary then "result" is updated (gets a value/an ASTEROID component). But this procedure is called by "When ANY ImageSprite.CollidedWith". So, "other" being a component else than an "asteroid" - my be a fire/laser - doesn't change "result" from its initial "not found". And there are indeed many sprites whose colliding events could call the "When ANY ...." with the consequence of not changing "result" from "not found". As a solution you should find a filter for asteroids. Other sprites shouldn't lead to calling the "getValue". Perhaps:(I didn't try it; you know your app better than I do).: