How do I make a barrier follow you

so basically put down multiple barriers everywhere. and set them to be invisible at game start. Then make a coordinate device and make it so that when the player gets near a barrier, it will be visible and when the player gets away from it, it will turn invisible.