- Home /
Question by
Crystalline · Nov 29, 2013 at 02:39 PM ·
multiplayernetworkid
Get the ID/name of the player that joined the game.
Hi.
How do I get the name / id of the player that joins the game?
function OnConnectedToServer
{
get the ID of the player
}
And another question would be..quite hard I guess, but : How do I get the player ID that collided with a certain object?
Any help greatly appreciated!
Comment
The question is answered yet: http://answers.unity3d.com/questions/47443/multiplayer-ids.html Set that question...
Answer by z3nth10n · Nov 29, 2013 at 09:28 PM
Well that's a repeated but well, if you don't search in Google you can't solve it by yourself...
You only had to do that:
void OnConnectedToServer() {
print("Player ID is " + Network.player.ToString());
}
Original answer: http://answers.unity3d.com/questions/47443/multiplayer-ids.html