`NetworkObject` `CheckObjectVisibility` doesn't work on client connection
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- game-dev, networking
调研方向
从 NetworkObject 的 SpawnWithObservers、Spawn 和 CheckObjectVisibility 行为入手,对比报告中链接的 spawning 和对象可见性文档。复现 CheckObjectVisibility 返回 false 时的 late-join 序列,并确认对象在客户端上仍然不存在;完成标准是可见性也会对未来 late-join 的客户端生效。
由索引模型根据 Issue 内容生成。
描述
Description
I want to spawn a networkprefab without any client visibility, first i tried to set no observers before spawn:
NetworkObject.SpawnWithObservers = false;
NetworkObject.Spawn();
this results a spawned object with zero observers, but when a late-join client connects, the object gets spawned on client. The documentation says this is the intended normal behavior, because it only works at the initial spawning.
Then, the documentation says the CheckObjectVisibility will work at both initial spawning and new client connection, so i tried this:
NetworkObject.CheckObjectVisibility += _ => false;
NetworkObject.Spawn();
it did spawn with no observers as the previous approach, but when late-join client connects, it still spawn the object on client.
Reproduce Steps
- start server/host
- spawn a network prefab with
NetworkObject.CheckObjectVisibility += _ => false; - start a client and connect to server
Actual Outcome
a spawned object with visibility always set to false still spawns on late-join client
Expected Outcome
a spawned object with visibility always set to false should be invisible to all connected client and future late-join clients
Environment
- OS: [win10]
- Unity Version: [6000.0.32f1]
- Netcode Version: [2.1.1]
- 主要语言
- C#
- 星标
- 2.3k
- 派生
- 465
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 39
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/com.unity.netcode.gameobjects 的其他 Issue
-
TimeSyncMessage is sent reliably, so a late one resets the client clock backwards and stalls its NetworkTransforms可能已有人在做 @reginaldalfret 于 8 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 52/100
Unity-Technologies/com.unity.netcode.gameobjects#4249 ·
维护者通常 3 天内回复
-
NetworkTransform: half-float base update dropped as out of order when UseUnreliableDeltas is on, so later deltas decode ~2 m off可能已有人在做 @NoelStephensUnity 于 8 天前认领。 未关闭port:3.x-completed priority:medium stat:imported type:bug
难度 4/5 3-5 天 新手友好度 57/100
Unity-Technologies/com.unity.netcode.gameobjects#4248 ·
维护者通常 3 天内回复
-
Tracking type:feature-2.x
难度 5/5 一周以上 新手友好度 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 条评论 ·
维护者通常 3 天内回复
-
Tracking type:feature
难度 4/5 3-5 天 新手友好度 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 条评论 ·
维护者通常 3 天内回复
-
priority:medium stat:imported type:feature type:feature-2.x
难度 4/5 3-5 天 新手友好度 42/100
Unity-Technologies/com.unity.netcode.gameobjects#3706 · 5 条评论 ·
维护者通常 3 天内回复
查看 Unity-Technologies/com.unity.netcode.gameobjects 的全部 Issue
相似的 Issue
-
hand-to-AI
难度 2/5 1-3 小时 新手友好度 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
bug python
难度 1/5 1 小时以内 新手友好度 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
维护者通常 13 天内回复