spawning a widget

Guys I using 2dsidescroller and I developing a game.And in this game I want to spawn a widget with a sprite.I mean if it comes to somewhere in our map the widget will be visibile.And when character start move forward the widget become invisible again.So how can I make it happen ? what can use for this job and you do not have to say all things just say the component ı should use…