Getting Friends Data

To get the friends' data, do as in the code snippet below:

[SerializeField]
SteamFriendsList steamFriendsList;

IEnumerator AsyncGetFriendsList()
{
    List<SteamFriendEntry> friends = steamFriendsList.GetFriends(true);
    
    // Wait a while for the avatar images to load or ignore this line
    // if you only want to get the names of the player's friends
    yield return new WaitForSeconds(1.5f);

    foreach (SteamFriendEntry steamFriend in friends)
    {
        // Do what your imagination tells you
    }
}

An advanced working example of the Friends List module can be found at Assets > Lucky Raccoon Games > Really Simple Steam Integration > Demo > 04 Friends List

Last updated