Hello everyone, I am working on the replication for opening a chest, the problem I am having is that I can’t seem to get the client to be able to open a chest for everyone else to see. I can do this fine on the server, I just want it so that no matter who opens/closes the chest, it opens/closes for everyone (the chest should look the same on everyone’s screen). Currently I am trying this out with replicated custom events. I have also tried using repNotify with an IsChestOpen? variable (the repNotify function opens/closes depending on the variable), but as far as I have observed, only the server can modify repNotify variables, so how would I get this to work? My chest is just an actor that is on the ground, what do I replicate, and where? Thanks ahead of time for the help!
EPIC Has great replication tutorials that deal with EXACTLY what you are asking.
https://www.youtube.com/watch?v=TbaOyvWfJE0&list=PLZlv_N0_O1gYwhBTjNLSFPRiBpwe5sTwc
Hope these help.
I’ve watched those, but none of them deal with the problem I am having, in their chest example, it only deals with the client opening a chest, which I can already do.
If you have it just as an actor on the ground then wouldn’t you want to convert it over to a blueprint? Or an actor with a custom component added to it?
It is, I imported a chest mesh, and created an actor BP, and dragged my mesh into the viewport, and in the event graph I have code to open itself when the user presses a button and is within collision box. The problem is that I can’t get a client to be able to open it for all players in the game.
You checked out the content examples -> Network_Features map? The final chest in there seems to do what you want I am pretty sure.
I’ll check now.
When a client does something it has to call a method or event that only the server runs, and changes the state of the chest and replicates that down to the clients. That code must execute on the servers side.
Excuse me, if I talk stupid. But what if you only send Input to the server and let the server replicates it back to you.
That way, the server handles the Input for that pawn and chest and everything.
As I said, I’m sorry if that makes no sense, as I am just getting started.
I’ve got it working with repnotify guys, thanks for the help!
That was the method used in 2.4 in the content examples 1 yeah? seems like the best way to handle it. Just need to manage your range on the notification so that you don’t see it open infront of you when you get close to it. You probably want to make that a variable that you can manage on each instance of it so that you can tweak it on a case by case basis.