Unity Networking: How to Spawn GameObjects from Non-Player GameObjects at Runtime

preview_player
Показать описание
If you need to spawn GameObjects into your multiplayer Unity game that can spawn other GameObjects too and are having problems - this video should clear some things up for you.

It should fix the following error: NetworkServer is not active. Cannot spawn objects without an active server.
And the following warning: Trying to send command without authority.

I did forget to use isLocalPlayer in this video, that is why I still got one warning with Cube4. Other than that the last cube's solution should fix your problems.

The reason you might get those errors should be that you are not spawning your non-player GameObject with NetworkServer.SpawnWithClientAuthority()

Background music (00:03):
Kisma - Fingertips

Background music (03:39):
Krakn - Aurora

Background music (06:58):
Egzod - Mirage (feat. Leo The Kind)

Background music (10:24):
Halcyon - December (feat. Gian)
Рекомендации по теме
Комментарии
Автор

Hello, do you know is there is a possibility to open and execute a command line into hololens ?

hugolammens
Автор

my objects only show in one of the windows, why are they not showing up to all players?

DiegoOliveiraProf
Автор

help me, everytime i use SpawnWithClientAuthority, it says null reference exception or player is not player

lukexplay
Автор

Hi,
Great tutorial and very well explained. However I didn't get my project working like yours. Could I maybe send you a mail or contact you in any way?
Thanks in advance

feyokorenhof
visit shbcf.ru