Properties that uses DOREPLIFETIME_ACTIVE_OVERRIDE (ex. RepRootMotion ) will also skip replication when an actor channel is newly opened.
This means that if the variables on the server side do not change, the opportunity to synchronize the property will be lost forever.
ACharacter::RepRootMotion.IsActive on a client will be fixed to a false value due to this behavior, and it disables root motion movement synchronization.
The following workarounds works. It will check the properties when the actor channel is newly opened regardless of the DOREPLIFETIME_ACTIVE_OVERRIDE flag.
// Compare the specific FRepParentCmd. // Returns true if the property (or any of its nested FRepLayoutCmds) has changed. static bool CompareParentProperty( const int32 ParentIndex, const FComparePropertiesSharedParams& SharedParams, FComparePropertiesStackParams& StackParams) { const FRepParentCmd& Parent = SharedParams.Parents[ParentIndex]; const bool bIsLifetime = EnumHasAnyFlags(Parent.Flags, ERepParentFlags::IsLifetime); // Active state of a property applies to *all* connections. // If the property is inactive, we can skip comparing it because we know it won't be sent. // Further, this will keep the last active state of the property in the shadow buffer, // meaning the next time the property becomes active it will be sent to all connections. #if 1 // workaround const bool bIsActive = !SharedParams.RepChangedPropertyTracker || SharedParams.RepChangedPropertyTracker->Parents[ParentIndex].Active || SharedParams.bIsInitial; #else const bool bIsActive = !SharedParams.RepChangedPropertyTracker || SharedParams.RepChangedPropertyTracker->Parents[ParentIndex].Active; #endif const bool bShouldSkip = !bIsLifetime || !bIsActive || (Parent.Condition == COND_InitialOnly && !SharedParams.bIsInitial);
[Link Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-119442 in the post.
4 |
Component | UE - Networking |
---|---|
Affects Versions | 4.25 |
Target Fix | 5.4 |
Fix Commit | 31269720 |
---|
Created | Jul 12, 2021 |
---|---|
Resolved | Sep 30, 2024 |
Updated | Oct 15, 2024 |