- Home /
Mirror and Unity: How to store, reference, and compare connectionToServer.connectionId in one script,Mirror and Unity: How to store and compare differenct connectionToServer.connectionId in one script
Hello, I'm trying to make one networkbehavior script that controls player1 and player2. I need a way to differentiate between the two different players, so I chose to try and reference their connectionToServer.connectionId. I'm new to coding so syntax is sometimes hard for me. Im currently using the "public override void OnStartClient(){}" event for where I put my code in the networkbehavior script. Should I use an if statement? In otherwords if (connectionToServer.connectionId == something) {then execute this code here} What would I compare the connectionToServer.connectionId to? what is the something? I'm confused because each client has a different connectionToServer.connectionId and I don't know what it will be. So I don't have a constant value to compare it to. Thank you for any help on this.
Your answer
Follow this Question
Related Questions
Sprite image not changing 0 Answers
How to "slide" sprite a set distance? 1 Answer
Object jumps right after the attached HingeJoint2D is Enabled 0 Answers