Hello, I’m doing a multiplayer game where the players have to finish a task in a Room so the door opens only for that client so the client can go to the next room. At first, I was trying to have a static mesh of a door and open it, but the door opens for both clients. So now I’m trying to do an invisible wall (box collider) that disables collision when a client finishes a task but I think I’ll have the same problem with the door. Any ideas on how could I solve this problem?
I’m only using blueprints.
Thank you.
There are collision channels in the project settings you can use for things like this.
I believe they are listed under “collision” but I don’t have UE open atm to check.
I see, I’m gonna check it right now.
You can use this from PrimitiveComponent
Adding doors to players’ capsule component should do the trick.
You’ll have to do it on both server & client sides.
Hello,
Thank you, is working exactly as I wanted it now.
For anyone interested or have the same problem this is my code.
I have a box trigger and a door (static mesh) I also add a new Collision Channel “InvisibleDoor”. So when a player overlaps the box first I check if is controlled locally. Then check if it has a BPI (I’m using Interfaces because I like it more this way). Then I get the unique Player ID. The Room will have an int-array of all the players that can pass, so I can easily decide which player can or not pass (the array has to be replicated). Then I just Find if the ID is in the array of players that can pass. If they can pass I make a call to the BPI again and set the collision on the BP_Player.
I’m not sure if I have to make an RPC there but it works with the RPC, I’ll check that later.
Now that I also have a Ref of the player when overlaps. Once the overlap ends I just call the BPI again so that in the next room, the player can not pass the door until that room adds it to their array.
1 Like
Hello, sorry but I’m using only blueprints. My c++ skills are not that good and it would be even more difficult if I try to do multiplayer with my current c++ skills .Thank you for reply tho
That function is also callable from blueprints.