SmartFox Usernames Question

Hi comm unity!

I am trying to retrieve the username of the instantiated user from the smartfoxer.

I tried this:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;

public class NewBehaviourScript : MonoBehaviour {
	
	
    public class User
	{
		private int id;
		private string name;
		private Hashtable variables;
		private bool isSpec;
		private bool isMod;
		private int pId;


		public User(int id, string name)
		{
			this.id = id;
			this.name = name;
			this.variables = new Hashtable();
			this.isSpec = false;
			this.isMod = false;
		}    
     

}

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
        Debug.Log=(user.GetName());
	}

	
}

But it gives me errors :frowning:
I really dont know where to go from here
as I tried to understand all tuts and tricks
without result :frowning:

can someone help me out I just want the username
to display in a GUIText attached to the remotePlayer.

I managed to retrieve my own username btw that was easier :slight_smile: but not what I wanted :frowning:

Thank you so much in advance,

RemiX
1

Nice, simple networking game, good luck.

I think its because the local client doesn’t know the remote clients’ usernames. You would have to make your server broadcast a player’s username to all other players.