Rep Notify Not Using the Clients Values

Space Grouse Games
Sun, 26 Jan 2025 15:10:54 +0000
Multiplayer & Networking

Bottom Line Up Front: Rep notify is working, but it is setting the client’s character mesh to be the same as the hosts rather than their own. What do I need to change to get it to use the client’s value instead?

I’ve likely overcomplicated this. But this is the process.

1. I made a blueprint component that includes a structure array. The structure array contains several different variables for each piece of a players equipment. I added the equipment struct to the player controller. This is the struct.

2. Using the RedPoint Games EOS online plugin the player pulls a save game from the cloud and sets it in their game instance. Within the save game is the same equipment array struct that is in the blueprint component. The rest of this process then runs and the player has their correct custom character.

3. The player joins a listen server and on begin play the controller gets the save game/equipment struct from the game instance and set’s the controller’s/blueprint component/equipment struct

4. An RPC on server then gets the game mode and calls a function within the game mode that spawns the player character. One input of that function is the BP player controller, and that controller is used to set the owner of the character within the game mode’s function.

5. In the game mode, immediately following the character spawn, an unreplicated event is called within the BP controller called “Set Equipment”, which has the new character BP as an input.

6. Within “Set Equipment” the character BP as set as a variable and then another event is called within the character BP also called “Set Equipment”, but the character BP even is replicated on the server. That event has the controller’s blueprint component as an input.

7. Within the character BP “Set Equipment” I get the equipment struct from the blueprint component and set w/ notify the same variable within the character BP.

8. Within the function called by the rep notify I get the various variables from the equipment struct and set child actor classes and skeletal mesh assets of the character.

At this point the client and host both have a custom character, but the client has the host’s custom character rather than their own (the one they had before joining the listen server). I thought that perhaps I needed to have the blueprint component in the player state rather than the controller, but when I tried that I couldn’t get the rep notify to run for the host and client.

7 posts - 4 participants