Description

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.

Steps to Reproduce

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

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Networking
Affects Versions5.5
Target Fix5.6
CreatedJul 19, 2024
UpdatedJul 29, 2024
View Jira Issue