Merge branch 'Withaust-master'

This commit is contained in:
Wojtek Figat
2023-06-19 18:00:00 +02:00
2 changed files with 6 additions and 2 deletions

View File

@@ -80,7 +80,11 @@ void NetworkReplicationNode::Update(NetworkReplicationHierarchyUpdateResult* res
const float networkFPS = NetworkManager::NetworkFPS / result->ReplicationScale;
for (NetworkReplicationHierarchyObject& obj : Objects)
{
if (obj.ReplicationFPS <= 0.0f)
if (obj.ReplicationFPS < 0.0f)
{
continue;
}
else if (obj.ReplicationFPS == 0.0f)
{
// Always relevant
result->AddObject(obj.Object);

View File

@@ -20,7 +20,7 @@ API_STRUCT(NoDefault, Namespace = "FlaxEngine.Networking") struct FLAXENGINE_API
// The object to replicate.
API_FIELD() ScriptingObjectReference<ScriptingObject> Object;
// The target amount of the replication updates per second (frequency of the replication). Constrained by NetworkManager::NetworkFPS. Use 0 for 'always relevant' object.
// The target amount of the replication updates per second (frequency of the replication). Constrained by NetworkManager::NetworkFPS. Use 0 for 'always relevant' object and < 0 for 'never relevant' objects that would only get synched on client join once.
API_FIELD() float ReplicationFPS = 60;
// The minimum distance from the player to the object at which it can process replication. For example, players further away won't receive object data. Use 0 if unused.
API_FIELD() float CullDistance = 15000;