Hello!
Let me start by saying, I’m very new to Unreal Engine and Game Development as a whole. I understand that Networking is a very tough subject to work on as a beginner, and I’m trying my best to wrap my head around it.
I’m working on a method to picklock a door, and then once the door is finished being picked, to repnotify the door state to all other clients.
I am utilizing a dedicated server, but in the screenshots below, you will notice I’m using the listen server. I’m only doing this to show that the server is not receiving the updated door state.
The way I have all of this set up is:
DE_DefaultCharacter (Character)
This detects my input “IA_AlternativeInteract” and runs a function called “BPI Trace” through the remote pin. I have a custom event called “SRV_AlternativeInteract” which also connects to this function, which is set to Run On Server.
Inside of the BPI Trace function, it does a line trace, gets the hit actor, and then sends a “AlternativeInteract (Message)” from my “BPI_Interact” interface through the authority node. This also gets a Character Reference of self, for use to set the Actor Owner. The remote node is connected to the “SRV_AlternativeInteract”.
I have an Actor called “BP_NetDoor”, which implements the BPI_Interact.
I call the event inside of NetDoor and have a switch has authority which runs off of authority to set the door state, and the character ref.
My door state enum is a rep notify, and runs the custom events for each state.
The door state for “LockpickingActive” sets the door InUse boolean, then triggers the custom event “InitiateLockpicking”. The InitiateLockpicking event spawns the actor, and sets the character reference as owner. I have no issues with the correct client being the owner, this all works as intended, however, when the lockpicking is finished (OnPicked gets called as an Event Dispatcher inside of my BP_Lockpick class), it does not seem to run anything on server or other clients. It only runs on the owning client. I’ve tried to even change the “OnPicked (Binding)” to run on server, and multicast. If it’s set to run on server, nothing happens. If it’s set as non replicated, or multicast, only the owning client see’s the “OnPicked” nodes run.
Below will be photos of my blueprints for reference.
If you need any other information, I’m happy to supply it!
Unlocked On Owning Client only. (Server and other clients are still showing locked):
BP_NetDoor — AlternativeInteract event:
BP_NetDoor — OnRep DoorState:
BP_NetDoor — InitiateLockpicking event: