How to make a Sector where buildings can be built, and you will not be able to leave it

Yes instead of BP_PlayerCharacter_Master (linked to my project) you should cast to your own PlayerCharacter class