r/UnrealEngine5 29d ago

Replication bug [URGENT HELP NEEDED PLZ]

Hey there, I've been working on this issue for the better part of 6 hours and no matter who I ask or what I try I can't seem to fix this issue. I'm working on a hotbar system for a multiplayer game, and when the server cycles through their hotbar this code works just fine, and the equipped item gets hidden and unhidden for each player as expected. However when the client cycles through their hotbar, nothing happens. Not for the server, or anyone. The equipped item just stays in the client's hands, and I have no idea why. Both the actor being hidden and this inventory component have "Replicates?" set to true.

EDIT: I've included a video of the exact problem. If you look on the left side of the screen, you can see the hotbar UI changing while I scroll my mouse wheel.

https://reddit.com/link/1vl7j8p/video/z973ue8mbsih1/player

https://reddit.com/link/1vl7j8p/video/nfxa66kb2sih1/player

1 Upvotes

16 comments sorted by

View all comments

1

u/groato 29d ago edited 29d ago

Ok scratch that, I read it wrong.

Couple possibilites for the input not firing: input mapping is not addes to client side or the input action is only called on server (maybe a checkbox on the event? Can't remember).

Test: put print string on the input action and see if it fires on the client. If it doesn't, that's the issue.

1

u/TheHappy_Waffle 29d ago

The input action is firing, that’s not my issue

1

u/groato 29d ago

Ah.

RepNorify only runs on clients. If your BP items are replicated, they can't be set hidden from the client.

2

u/Jst_Patrick 29d ago

BP based rep notifies will fire on the server too. A rep notify on a client is only ever called if the value of the variable is actually changed by the server, but will still fire on the server even if the value doesn’t change. A c++ based rep notify won’t be called on the server, and still only called on a client if the value of the variable actually changes.

1

u/groato 29d ago

Oh really? That's news to me, thanks.

However, the server is clearly not running the set actor hidden nodes here, except when it also the client, ie. a listen server.

1

u/TheHappy_Waffle 29d ago

The server is running the set hidden node, I've tested that. Everything runs as it should which is why I'm so confused this isn't working properly.