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

    F1nch11

    Joined:
    Dec 28, 2020
    Posts:
    3
    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.

    upload_2022-1-1_14-46-52.png

    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.

    upload_2022-1-1_14-47-40.png

    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!