Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Mirror Networking - Destroying Players

Discussion in 'Multiplayer' started by F1nch11, Jan 1, 2022.

  1. F1nch11


    Dec 28, 2020
    Hello! I am currently attempting to find a way to remove the player object from a NetworkConnection in Mirror. Luckily, there appears to be a built-in way to do this. Unfortunately, I've been unable to get it to work. The code I'm testing is very simple. The following snippet is contained within a simple MonoBehaviour and is activated with a button push.


    The button push is definently registering, as all other logic works as intended. However, the player object stays. The components attached to the player object are as follows.


    As far as I can tell, the DestroyPlayerForConnection method is simply not doing anything, and I can't figure out why. The player object stays. Any help would be greatly appreciated, thank you!