How can I make it so the player can't move past a certain point?

I want my game coded so that when the player is moving and it is on certain coordinates, it can’t go past that point. It will act like an invisible barrier. I want this because my game is coded so that there is a wall that surrounds the map and whenever an object with a Box Collider touches it, it deletes. So when a bullet is fired, it moves until it touches the wall and deletes. But the thing is that the player can move and hit this wall and it deletes the player. So I want to see if I can get it so the player can’t move to the wall that deletes things. I do have a movement script for the player so I want to see if I can attach some code to the movement script to get it to work.

You could do as Jopa pointed above or scripting the wall collider so it only deletes some kind of GameObjects according to names, tags or whatever you want. I’d use “OnTriggerEnter” to do this.

Add collider to the player as well as the wall. You don’t have to script it, let the engine handle it for you. The only thing you should script is adding an exception for a player not to be deleted.