In the old Networking code, we would usually call on Network.Destroy(); to remove a game object in multiplayer games.
With the new UNET codes, I have no idea how to destroy game objects. Does anyone know?
Thanks in advance.
In the old Networking code, we would usually call on Network.Destroy(); to remove a game object in multiplayer games.
With the new UNET codes, I have no idea how to destroy game objects. Does anyone know?
Thanks in advance.
You have ask the server nicely to destroy
like so :
[Command]
void CmdPleaseDestroyThisThing(GameObject thing)
{
NetworkServer.Destroy(thing);
}
void Update()
{
//instead of where you would do Destroy(gameObject),
//put CmdPleaseDestroyThisThing(gameObject);
}
Thank you!
The new UNET would definitely benefit from video tutorials, and hopefully I can locate a good video tutorial series.