When the client receives a bunch, it will first apply all the new values for replicated properties before calling any repnotify functions for those properties. This means that in between the StaticMesh property being set and OnRep_StaticMesh being called, other OnRep functions may be called. If one of these OnReps results in GetStaticMesh being called, such as by setting a material on the mesh, an ensure will be triggered due to the KnownStaticMesh not matching the current StaticMesh.
See attached repro project.
Create a replicated actor with a replicated static mesh component.
Include on the actor a replicated property with a repnotify function. Have this repnotify call SetMaterial on the static mesh component.
On the server, change the static mesh of the component and this replicated property in the same update.
On the client, observe the ensure in UStaticMeshComponent::OutdatedKnownStaticMeshDetected get hit when the repnotify function calls SetMaterial.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-156362 in the post.
3 |
Component | UE - Networking |
---|---|
Affects Versions | 5.0 |
Created | Jun 10, 2022 |
---|---|
Updated | Apr 16, 2025 |
9456 - cmsinflexion |