Hi,
I am making an online multiplayer game and I am trying to assign each player a number and put it onto a TextMeshPro (username). I heard I can use OwnerClientId which spits out a consecutive digit for each player, but I get this error: “Cannot implicitly convert type ‘ulong’ to ‘string’” So I’m assuming OwnerClientID outputs a ulong and I need it to be a string. any way to convert it?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Unity.Netcode;
using TMPro;
using System;
public class usernameManager : NetworkBehaviour
{
[SerializeField] TextMeshProUGUI Username;
void Start()
{
if (!IsOwner) return;
Username.text = OwnerClientId;
Debug.Log(OwnerClientId + "; USERNAME: " + Username.text);
}
}