Creating a barrier in-game

Make an actor blueprint. Put a box collision in there(trigger box). Set up the collision for object types. Do your blueprints. Spawn with node “Spawn Actor of Class”.