When the gameplay framework component manager creates components as part of CreateComponentOnInstance, it passes in the requested class name as the literal name of the component instead of using the autogenerated name (which would be ClassName_1 etc). This gives it a consistent name, but it will also cause it to reuse a partially-destroyed component if it is destroyed and recreated before GC has time to delete the object. This confuses the replication system because it thinks it is literally the same component as before, so it never gets destroyed/recreated on the client and BeginPlay/EndPlay are out of sync on the client and server.
The exact behavior of this changed between 5.1 and 5.3 due to changes to component replication but both behaviors are not what the user expects. Ideally the server and client would get the same gameplay calls when a component is destroyed and recreated. Changing it to use the autogenerated names like default fixes this issue but may cause other problems.
Expected:
BEGIN PLAY is printed for the new component on both the client and server, and then every 5 seconds thereafter the same component prints END PLAY on both client and server with a new component being created (and repeating the cycle) thereafter.
Actual:
5.1 behavior: BEGIN PLAY is printed for both the client and server, after 5 seconds a new BEGIN PLAY prints for both the client and server but only the server prints END PLAY. The client will randomly log BEGIN PLAY depending on the exact time that components are replicated
5.3 behavior: BEGIN PLAY is only printed once on the client and END PLAY is never printed on the client because it never destroys the component
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-182465 in the post.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 5.1, 5.3 |
Target Fix | 5.5 |
Created | Apr 5, 2023 |
---|---|
Resolved | Sep 20, 2024 |
Updated | Sep 20, 2024 |