The cooker settings include the ClassesExcludedOnDedicatedServer/ClassesExcludedOnDedicatedClient lists, which specify classes that should be excluded when cooking a dedicated server/client. These lists are checked in UObject::NeedsLoadForServer/NeedsLoadForClient, and UWorld::SpawnActor will use these functions (via UObject::CanCreateInCurrentContext) to check if the actor can be spawned.
However, there doesn't seem to be any such check for components/subobjects (with the exception of components on blueprint actors), causing these classes to be spawned on the dedicated server/client.
Create an actor component, and either add its class to the "ClassesExcludedOnDedicatedServer" list or override UObject::NeedsLoadForServer to return false.
Create this component as a default subobject of an actor that exists on the server and client.
Package the project as a dedicated server.
Expected: the actor will still exist on the server, but it will not have its excluded component.
Actual: The excluded component will still be spawned on the server.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-193927 in the post.
5 |
Component | UE - Gameplay |
---|---|
Affects Versions | 5.4 |
Created | Aug 25, 2023 |
---|---|
Updated | Feb 13, 2024 |
10933 |