Navigate to the BP_PlayerInventoryComponent and select and change the following variables to “Replicated” and set the replication condition to “Owner Only”.

Hunger
Thirst
Stamina

Next in the BP_PlayerInventoryComponent select the health variable and change it to “Replicated”.

Next in the My Blueprint tab in the BP_PlayerInventoryComponent find the “Client Update Hunger” (You can use the search bar at the top) and right click the event name and find references, then in the find results panel go though and disconnect the node like show in the image below (You can delete them to keep the code clean I disconnected the example to make it easier to see)

Next repeat the last part for each one of these events:

Client Update Thirst
Client Update Stamina
Client Update Health

Once you have done this you can delete the events for each of these they look like the image below. (You can Delete all the highlighted nodes shown in the image, you will need to also do this for the events mentioned above) If you get errors after doing this it means that you didn’t delete all the calls to these events, go to the error nodes and remove them and if you need to reconnect up the code after them to the code before them.

Next Create a new custom event in the BP_PlayerInventoryComponent called “Client Update All Slots” and add an input variable of S_ItemInventory and change it to an array type. Set the event to run on client and tick reliable.

Then copy the images below

Next disconnect the disconnected nodes shown in the image below. Then create the event call to the “Client Update All Slots” like shown in the image.

Next add the highlighted nodes shown in the image below

After this go to the master character bp and in the components panel select the BP_PlayerInventoryComponent then in the details panel tick the option Replicate Component. Then go to the survival character and do that same (If it is already ticked in the survival character then that is fine)

Advertisements