Problem Using Sensors in 2D Platformer Game

I am trying to make a 2d platformer game and my agent needs to collect some gems and catch the player, i tried adding a grid sensor to my agent so it sees the gems and collects them but i couldn’t figure out how to use the grid sensor and there are no guides anywhere, i can add code/screenshots if necessary, please help.

This might help…
mbaske grid-sensor