One Way collision staticmesh

Hi,

I would like to do a one way wall but I can’t seems to find how to do it.
I have a constraint that the solution must work in multiplayer.

The “solo” solution was to play with a trigger and put on/off the collision on the StaticMesh, but this is not good for multiplayer as the other player will be impacted also.

Thanks,

Hello @Elvince,

I think I might have a solution for you that will work in a multiplayer environment.

Step 1: Add two new physics object channels similar to my picture below.

Step 2: Create a blueprint for your wall and make sure that whatever static mesh you are using for collision has similar collision settings as the one below. I circled the two settings that are the most important for this to work.

51867-blockpawn+2.png

Step: 3:
Add the code below to the event graph of your wall Blueprint. This code just takes whatever has overlapped the static mesh and checks whether it is our character controller. If the overlapped object is our character controller then it sets the Collision Object Type of the object’s capsule to our newly created “PawnBlocked” type, which should prevent the object from overlapping the wall in the future because of collision settings we set for the wall.

Although I haven’t tested it, this technique should work for a multiplayer game and should only block players who have previously overlapped the static mesh.

This was very experimental for me so please post any questions you have in the comments below.

I hope this answer helps,

Farshooter

I understand your proposal and it might work.
I need to be sure that the PawnBlocked Channel is strictly the same at the Pawn one just to be sure to not alter other behavior and use the Begin/End overlap to switch collision channel.

Thanks!

I just noticed one weakness of my solution. It will not work properly if there are multiple walls. If you cross through the first wall then all other walls will block you.

A solution to this would be to have a device like a collision volume or timer within the level that will reset you physics object channel back to Pawn to allow you to pass through other walls.