NetworkTransform misses sync when GameObject is re-enabled; add option for automatic reassertion
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp, unity
- 领域
- networking
调研方向
从 NetworkObject 处于非活动状态时 NetworkTransform 对 Teleport 的服务器权威处理开始,然后重现所描述的禁用、移动和重新启用序列。确定如何在重新激活时重新应用最新的权威变换,并验证客户端无需第二次调用 Teleport 即可接收到更新后的位置。
由索引模型根据 Issue 内容生成。
描述
Description
When using NetworkTransform in server-authoritative mode, if a NetworkObject is deactivated on clients (e.g. via SetActive(false) or scene streaming), any transform changes (e.g. via Teleport) made while it's inactive are not propagated to the client once it's re-enabled. This results in position mismatches, where the client sees the object at its old position while the server has already moved it.
There is no warning, and the desync is silent unless manually corrected.
Reproduction Steps
Spawn a server-authoritative NetworkObject with a NetworkTransform
Deactivate the object on all clients (via RPC or reparenting in a disabled object)
On the server, call Teleport(...) to move the object
Reactivate the object after a short delay
Observe: the client does not reflect the new position
Expected Behavior
Clients should receive the latest authoritative position of the object when it becomes active again.
Workarounds
Currently, we must:
Reapply Teleport() after reactivating the object, or
Use a coroutine to delay the teleport until the object is re-enabled, or
Use custom NetworkVariable logic or whatever boiler plate works instead of NetworkTransform
Suggested Fixes
Add a forceResyncOnEnable bool on NetworkTransform
Internally store the last known transform state, and resend it on reactivation
Or provide an OnNetworkObjectReenabled callback for developers to manually reassert state
- 主要语言
- C#
- 星标
- 2.3k
- 派生
- 461
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 20
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/com.unity.netcode.gameobjects 的其他 Issue
-
stat:import type:bug
难度 4/5 3-5 天 新手友好度 68/100
-
stat:reply-needed type:support
难度 4/5 3-5 天 新手友好度 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 条评论 ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · 5 条评论 · 已指派 1 人 ·
-
Tracking type:feature-2.x
难度 5/5 一周以上 新手友好度 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 条评论 ·
-
Tracking type:feature
难度 4/5 3-5 天 新手友好度 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 条评论 ·
查看 Unity-Technologies/com.unity.netcode.gameobjects 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
难度 2/5 1-3 小时 新手友好度 72/100
azurenoops/spin_agent#975 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
难度 2/5 1-3 小时 新手友好度 92/100
dotnet/AspNetCore.Docs#37699 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
SubtitleEdit/subtitleedit#15108 · 1 条评论 ·