Replication not changing location or rotation from client
I have a problem with replication. I'm trying to rotate or move object from client side. Move and rotation are executed in events marked as 'On Server'. The problem is that when I'm using this on server, everything works great. I'm able to see changes both on client and server.
But when I use it by client, Looks like the event are not executing at all.
asked Mar 22 '17 at 09:45 PM in Using UE4
a limitation with Client to Server Events (or also Functions/RPCs) is that only Player controlled Blueprints can send those Events.
So try sending this event from you player Character or PlayerController Blueprint, i.e. not from your Door's Blueprint directly.
E.g. using the Character: 1. Get the Character from your Door Blueprint, then... 2. Call a helper function or the Server Event directly on that Character with your Door as a variable. Note: Now you need that Door variable because the receiving Server Character now also needs the Door to interact with.
Tip for later: If you learn using Blueprint Interfaces you could create a more re-usable Server Event on your Character. An Interface (that you don't call Door but e.g. "Interactable_Interface_BP") and Implement in your Door could be used to send the Server a very general Events or Variables like "Toggle Object" or "Set State X" and any Door, Light, even NPC could use this kind of pattern if they also implement the exact same Interface.
PS: I can't remember the perfect documentation page, but here we see that On Server events use the player's character:
Explanation of the Net Owner: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/Networking/ReplicateFunction/index.html
Update: Rough example on how a Character Blueprint could send a Server event using an Interface (more elegant than hard-coding this only for doors).
Notes: See how I underlined the sending Event saying "if owning client" (here the Player Client owns this Character). I also underlined the fact that this is not about Doors (or Actors), this already uses my Interface to set states (here just an Integer, but could be enums, etc. :))
Follow this question
Once you sign in you will be able to subscribe for any updates here