Even with Replication, Client not updating Server
I have a first person setup with two problems, but I believe the same solution applies to both
1) When the player rotates the yaw of their camera by moving the mouse on the X axis, rotate the character's yaw to match it. If I run single player, this works fine. If I run it with a client/server setup, the client can see the server rotate, but the server cannot see the client rotate.
What do I need to do to get the Client to tell the Server to also rotate the player (and have it replicate to all other clients as well? Not yet implementing relevancy).
I have tried a few things, from promoting the value to a replicated variable to forcing the process to execute a custom event with Multicast enabled, but I'm mostly just guessing. I've followed the Epic tutorial series including Blueprint Networking, but I was unable to figure this out.
2) When the player interacts with an actor (a wall, in this case), attach the actor to the player. When the player interacts again, detatch the actor. Again, this works fine in single player or if the Server does it, but if a Client does it, no one else ever sees what is happening. The setup I have for this is a bit complex..
Wall implements an interface defining two functions: "On Use" and "On Use - Holding". When "On Use" is executed, it is passed in a "Character" variable, it casts it to the character I have created and executes "Set Holding Object" on the character. When "On Use - Holding" is executed, it is incredibly similar, does the same thing but executes "Place Held Object" on the character.
When the player presses "E", if the character is not "Holding" an object, it runs a Single Line Trace to find an actor within 200 units, and executes its "On Use" event. If the character is holding an object, it executes that actor's "On Use - Holding" event.
So the player presses E which triggers the "On Use" event of the wall which triggers the "Set Holding Object" event on the character. The player presses "E" again which triggers the "On Use - Holding" event of the wall which triggers the "Place Held Object" event on the character. Both "Set Holding Object" and "Place Held Object" are here:
That's about it. Overall I'm really unsure as to what part I need to focus on in order to make sure this is replicated properly. All the other clients need to know is that the wall is moving and they need to see it moving.
asked Sep 12 '14 at 06:39 PM in Blueprint Scripting
I am struggling with replication too, certain events in my character BP just don't run on client even though the replication settings are the same and the writing on my custom events saying what replication setting they are using is not updating when I change the replication type....
Any ideas as to what this is about?
answered Dec 20 '14 at 01:36 AM
The Cheese Dragon
This just came from a lack of understanding replication. The whole thing was a complete mess I ended up remaking from the ground up.
answered Oct 18 '14 at 07:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here