For instances that are not a dedicated client or dedicated server (e.g. packaged games with TargetType "Game"), GIsClient will be true, but GIsServer will be false.
This leads to objects that return false for NeedsLoadOnClient to not be loaded on game targets, including those running as a listen server (see FObjectInstancingGraph::GetInstancedSubobject).
From the comments around these globals, it is not clear if GIsServer is only meant for dedicated server instances. This behavior is also inconsistent when compared to running in PIE, which can also run as a server or client and sets both GIsClient and GIsServer to true. In either case, it would be helpful to make the comments around these globals more clear as to when they should be expected to be true.
Create a component class that overrides NeedsLoadForServer to return true and NeedsLoadForClient to return false.
Have an actor create a default subobject of this component.
Run a listen server and client as standalone editor instances, or from a packaged game target.
Expected: the component will exist on the server but not the client
Actual: the component will not exist on either instance
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-219750 in the post.
1 |
Component | UE - Networking |
---|---|
Affects Versions | 5.5 |
Target Fix | 5.6 |
Created | Jul 19, 2024 |
---|---|
Updated | Jul 29, 2024 |