Description

This seems to happen due to a precision error when calculating the relative transform between the socket and the component being attached. Occasionally, one of the transforms will have a scale of (0.999..., 0.999..., 0.999...) rather than (1,1,1), which results in the component's RelativeScale3D being set to a value very close to (1,1,1) in USceneComponent::AttachToComponent. Because the relative scale will be replicated with this new value along with the attachment info, bNetUpdateTransform will be true in USceneComponent::PostRepNotifies, causing it to skip zeroing the component's relative location on the client when attaching it.

Steps to Reproduce
  1. Spawn a replicated actor with a replicated root component on the server
  2. Immediately attach it to a socket on another replicated actor with the following attachment rules: Location Rule - Snap To Target, Rotation Rule - Snap To Target, Scale Rule - Keep World

Expected: the actor will be attached at the socket's location/rotation on both the client and server.

Actual: on the client, the attached actor may be at a large offset to the socket's location.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-172512 in the post.

2
Login to Vote

Unresolved
ComponentUE - Gameplay - Components
Affects Versions5.1
Target Fix5.5
CreatedDec 9, 2022
UpdatedFeb 13, 2024