How to create barriers that block some players but ignore another ones (4.27)?

In my game, I want to create some barriers, for example, on entrance into some zone, that block players by default but stop blocking when player executes some task. This action can be done by creating the custom object channel, setting collision profile of the player’s capsule to the “Custom” and setting the collision response to “Ignore” when the task has been executed. This way is the easiest but applicable only for two-three barrier types because the custom object channels are not unlimited. Another way is to create only one custom object channel, then create some “field” for several meters around the barrier, and set the collision response of the player’s capsule to “Block” or “Ignore” depending on the appropriate task state when the player overlaps the “field” (when the player is far from any barrier, the collision response to the barrier channel is not useful and can be in any state). With this barrier types are unlimited, but one cannot place different barriers near each other, or the collision result will be unpredictable. Maybe there is a better way to solve this problem, but I don’t know it. If somebody knows, I ask to write it.

hi,
i use tags to block or unblock certain areas… in my case i use onoverlapEnter on the collider and look if my character has the tag in his tag array… if not he cant move and gets a little push back so onoverlapexit is called and then he gets his movement back… this works very well for my scenario but i do not know if this solution is what you are looking for :slight_smile:

cheers :vulcan_salute:

1 Like

Hello @AustrianMunzter, I think this way is not reliable enough. If that “push back” is too strong, it can launch the player far, which is incredible. If it is too weak, serie of stronger pushes forward can get the player beyond the barrier. I need a way that actually blocks overlapping the barrier when it is not unlocked.

I mean, you could use the channel solutions you posted in your OP together. So, if it is just one barrier with no others around it, you could do the overlap field with barrier type 1. But, if you need 3 barriers right next to each other, you could set those to barrier types 1, 2, and 3.

I guess I don’t know much about your game though. How many different barriers are you going to put next to each other? If I remember correctly, UE gives you like 10 custom channels to work with (or it might have even been more than that?).

1 Like

You can use this from PrimitiveComponent

Adding barriers to players’ capsule component should do the trick.
You’ll have to do it on both server & client sides.

I think the answer of @Detach789 will be a solution. The topic is not actual now.