2

I have a multiplayer unity game (actually it is a two player game),
One player runs as host and the second one connects as client.
But I want to client to choose which scene to load.
Which means I need to either use a [Command] to do so.
But I run into client authority issues and get this error: Trying to send command for object without authority.

If I try to set the objects local authority I get: AssignClientAuthority can only be call on the server for spawned objects.

Even if I remove the authority and reset it it ends up with the same owner.

I have tried sending messages using SendAll too.

So is there another way that I am missing?

4

1 回答 1

2

据我所知,如果不使用播放器对象,就没有干净的方法可以做到这一点。我所做的是为播放器对象提供一个组件,该组件仅将函数调用路由到服务器端的相关对象。在这个播放器组件中没有执行函数的逻辑,它只是传递调用。

于 2016-06-01T04:40:10.017 回答