Unity-Technologies / Unity-Technologies/com.unity.netcode.gameobjects
Sharing ownership between two players
@NoelStephensUnity 已经在做这个了。
开始于 2023年5月10日。
- 主要语言
- C#
- 星标
- 2.3k
- 派生
- 461
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 20
描述
This is a follow up question after #2512, where @NoelStephensUnity helped me a lot with making a solid and smooth movement of an object by a player.
But since multiplayer games are about cooperation, carrying stuff together is one of the essentials features in our game.
I'd like to make it that when one player tries to carry a large thing, it struggles, whereas two can do it easier.
The problem is, they both should be able to move the object they are carrying. And they are client-side authoritative.
So I can't just change the ownership of the object, because another player is going to have a delay.
The only idea I have is to let them simulate locally object's state, ignoring the correct one from the server. And once they drop the object, it switched back to updates from the server. I think this should work, at least, I can't tell why not.
But I think I don't understand the solution @NoelStephensUnity provided me with to 100%. I see that it disables server updates and lets client simulate rigidbody, but it also handles the jitter problem by making sure that the authority is completely switched, and I just don't understand how I can make it more generic, so I could just toggle it when I need it.
Do you think it's going to work or I am completely wrong about the approach? Maybe it can be achieved easily?
If so, could you please you elaborate on your solution? As I said, I'd like to make it generic.
Thanks a lot!
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。