I am trying to make a mechanic where if you walk over to a "LootBox" as I call it in my code (green or brown boxes as they appear in my game), and press Escape to interact with it, it will show you the two health kits that are inside of it at the top right of your screen. This feature works sometimes, and other times it crashes and greenfoot says it is a nullPointerException error. You should be able to download my work on my page, and see what I am talking about.
P.S. you must walk right over these boxes to interact with them.
P.P.S. I was going to just do a post on this issue, but I just made a scenario for it public so that whoever wants to help me can see it more clearly.
