Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

Third Party Mirror OnStartLocalPlayer not calling

Discussion in 'Multiplayer' started by Infanago, Dec 12, 2023.

  1. Infanago


    Dec 10, 2023
    I have a script component in the player prefab which handles setting up the players camera when they spawn, no errors are present in the code but SetupCamera method is not initiated as OnStartLocalPlayer is not called when the clients player object is spawned in and "Spawned" is never output in console. This issue continues with two editors simulating host and client as well.

    Code (CSharp):
    1. public class PlayerMovement : Mirror.NetworkBehaviour
    2. {
    3.   public override void OnStartLocalPlayer()
    4.     {
    5.         Debug.Log("Spawned")
    6.         SetupCamera();
    7.     }
    8. }
    I can't find any information online on why, could someone please point out what I am doing wrong?