How do you make an object appear and disappear depending on position of player?

I’m making a maze game. My goal is when you stand on one path and look at a path next to the path your on. That you can’t see the game-objects or players that are on the path unless you are standing on that specific path. How can you make this happen? Thank you in advance if you know or don’t know the answer to this.

If you’re wanting to block out game objects from the view of the camera, you should look into occlusion culling.

You could raycast to determine which path you are on, then display the items.

You could even boxcast(or spherecast), then enable models in front of you. (Empty GameObject, with a Collider, then use that to enable the mesh/scripts/etc)