Mirror/doc/Articles/General/PlayerControllerToIdentity.md
James Frowen b86a611674
Restructure docs (#2249)
* moving all guides to Articles folder

* updating toc for root and articles

* fixing toc

* css on side toc

* fixing links on index
2020-09-16 22:27:05 +01:00

1.3 KiB

Changing playerController to identity

If you need to fix up a project after NetworkConnection.playerController was changed to identity these instructions should be helpful.

  1. Open your Unity project and look for Assets/Mirror/Runtime/NetworkConnection:

Project window in Unity

  1. Open this file in Visual Studio or Visual Code from Unity and look for these lines:

Code snip in NetworkConnection.cs

The line numbers could be off a bit if minor file changes happen above them after this document was written.

  1. Comment the last line shown:
    // public NetworkIdentity identity { get; internal set; }
  1. Double-click and then right-click playerController and select Rename:

Start of Rename process

  1. Change playerController to identity and click Apply:

Finishing the Rename process

Visual Studio will now have applied the change throughout your project, but you're not done yet!

Without using the replace feature this time, simply retype the name back to playerController and un-comment the last line in the code image that you commented out in step 3.

Your code should now look like the code image again.

Code snip in NetworkConnection.cs

Save your work!