Unity [UNET] Sync non-player object transform

冷暖自知 提交于 2019-12-24 07:26:20

问题


I have a question regarding the UNET system.

There are some objects in the scene that can be picked. I want to synchronize transform that object when a player picks it up.

The object has a NetworkIdentity component with LocalPlayerAuthority checked. It also has a NetworkTransform script, but the transform synchronizes only from host to clients, not the other way around. So if I move the object on the host side all clients see the change, but if the client moves it only that particular client sees the change. What do I need to do in order to make it synchronized on both sides?


回答1:


Never mind, I already solved this problem.

What I had to do is to AssignLocalAuthority of the non-player object by using player object.



来源:https://stackoverflow.com/questions/38960270/unity-unet-sync-non-player-object-transform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!