
It feels like there are two Lights inside the Core on stage, one Predicted and the other not. Does anyone know how to disable the rolling Light?
There is also another problem, and it seems to me they have a similar cause. Orefields are spawned on the server side (i.e. they are not in SubScene at the time of launch and the client should not know about those that are located further than 100 from the ship). And as you can see in the gif below, this is what happens, OreFields appear only at a distance of 100 from the ship, but the light, which is also contained in the OreField prefab, continues to synchronize with the client at all times.
OreDistanceSystem.cs
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.NetCode;
using Unity.Transforms;
using UnityEngine;
public struct GizmosLine : IComponentData
{
public float3 Start;
public float3 End;
public Color Color;
}
[BurstCompile]
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
public partial struct OreDistanceSystem : ISystem
{
[BurstCompile]
public void OnCreate(ref SystemState state)
{
//state.RequireForUpdate<Ship>();
state.RequireForUpdate<OreField>();
}
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
var rev = SystemAPI.GetSingletonRW<GhostRelevancy>();
if (rev.ValueRO.GhostRelevancyMode != GhostRelevancyMode.SetIsRelevant)
{
rev.ValueRW.GhostRelevancyMode = GhostRelevancyMode.SetIsRelevant;
}
rev.ValueRW.GhostRelevancySet.Clear();
foreach (var (_, shipTran, shipCon, shipGhost) in SystemAPI
.Query<RefRO<Ship>, RefRO<LocalTransform>, RefRO<GhostOwner>, RefRO<GhostInstance>>())
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, shipGhost.ValueRO.ghostId), 1);
foreach (var (_, oreFieldTran, oreFieldGhost) in SystemAPI.Query<RefRO<OreField>, RefRO<LocalTransform>, RefRO<GhostInstance>>())
{
if (math.distance(shipTran.ValueRO.Position, oreFieldTran.ValueRO.Position) < 100)
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, oreFieldGhost.ValueRO.ghostId), 1);
}
}
foreach (var (_, floorTran, floorGhost) in SystemAPI
.Query<RefRO<Floor>, RefRO<LocalTransform>, RefRO<GhostInstance>>())
{
if (math.distance(shipTran.ValueRO.Position, floorTran.ValueRO.Position) < 2000)
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, floorGhost.ValueRO.ghostId), 1);
}
}
foreach (var (_, bulletTran, bullerGhost) in SystemAPI
.Query<RefRO<Bullet>, RefRO<LocalTransform>, RefRO<GhostInstance>>())
{
if (math.distance(shipTran.ValueRO.Position, bulletTran.ValueRO.Position) < 500)
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, bullerGhost.ValueRO.ghostId), 1);
}
}
foreach (var (_, oreTran, oreGhost) in SystemAPI
.Query<RefRO<Ore>, RefRO<LocalTransform>, RefRO<GhostInstance>>())
{
if (math.distance(shipTran.ValueRO.Position, oreTran.ValueRO.Position) < 100)
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, oreGhost.ValueRO.ghostId), 1);
}
}
foreach (var (_, gateTran, gateGhost) in SystemAPI
.Query<RefRO<Gate>, RefRO<LocalTransform>, RefRO<GhostInstance>>())
{
if (math.distance(shipTran.ValueRO.Position, gateTran.ValueRO.Position) < 1000)
{
rev.ValueRW.GhostRelevancySet.TryAdd(
new RelevantGhostForConnection(shipCon.ValueRO.NetworkId, gateGhost.ValueRO.ghostId), 1);
}
}
}
}
}

Thank you in advance for any help!

