RepNotify variables passed by reference to a function or macro that then change the value of the variable do not trigger the OnRep function on the Server. This is inconsistent with the behavior with Server RepNotify functions firing when not passed by reference.
Attached is a user-made project demonstrating the issue.
Reproduced in 4.7.6, 4.8.1, and Main (//depot/UE4/Promotable-CL-2605171)
1. Create a new project
2. Create a new Actor Blueprint
3. Set the Actor BP to Replicate and Net Load on Client
4. Create a new variable
5. Set the variable to RepNotify
6. In the OnRep function, Print String "RepNotify fired"
7. Create a new function
8. Give the function an input of the same type as the variable created in step 4
9. Set the input to Pass-by-Reference
10. Set By-Ref Var with a Value of 20
11. In the Event Graph, call the function on Begin Play
12. PIE
Result:
The OnRep function is never fired on the Server. If the same is played with 2 players, the Client will fire the OnRep function but the Server will not
Expected:
Both Server and Client fire the OnRep function
Head over to the existing Questions & Answers thread and let us know what's up.
22 |
Component | UE - Networking |
---|---|
Affects Versions | 4.7.6, 4.8.1, 4.9, 4.13 |
Created | Jul 1, 2015 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Oct 24, 2022 |