Quick Start Guide

This guide gets you up and running with Universal Friend List in the fastest way possible. For detailed explanations of each step, see the individual documentation pages.

5-Minute Setup

Step 1: Open the Demo Scene

Navigate to Assets/ElderWorldStudio/FriendList/Scenes/Demo.unity and open it. This scene contains a fully configured example of the friend list system.

Step 2: Configure Your Backend

In the Hierarchy, find the FriendManager object (or FriendManagerInitializer). In the Inspector:

  • Find the Settings field and ensure it's pointing to Resources/FriendManagerSettings
  • Set Backend Type to match your networking solution:
    • Photon PUN projects → Select PhotonPUN
    • Photon Fusion projects → Select PhotonFusion
    • Mirror projects → Select Mirror
    • Unity Netcode projects → Select UnityNetcode
    • FishNet projects → Select FishNet
    • Custom server → Select Custom
  • Set Use Native Implementation based on your choice:
    • true = Use your network's built-in friends (faster setup)
    • false = Use the custom server for cross-network friends

Step 3: Connect Your User ID

The friend system needs to know who the current user is. The method depends on your setup:

  • Native implementation: The system automatically uses the network's user ID
  • Custom backend: Set the UserId on FriendManagerInitializer or call FriendManager.Initialize(userId) after your authentication system provides an ID

Step 4: Test in Play Mode

Enter Play Mode and verify the friend list appears. With the demo scene, you can:

  • View the friend list panel
  • See how friend requests appear
  • Test the add/remove friend flow
  • See presence status indicators

Using With Custom Server

Node.js Server (Recommended for Real-Time)

If you want full friend functionality across different network types, or need server-side moderation, use the included Node.js server:

  1. Navigate to .Server/websocket/ in the package
  2. Open a terminal in that folder
  3. Run npm install
  4. Run npm start
  5. The server starts at http://localhost:3001
  6. Set UseWebSocket = true in FriendManagerSettings
  7. Set ServerUrl = http://localhost:3001
  8. Set WebSocketUrl = ws://localhost:3001/ws

PHP Server (Simple REST)

For simpler hosting or shared servers, use the PHP backend:

  1. Navigate to .Server/php/ in the package
  2. Configure config.php with your database settings
  3. Host the folder on a PHP-compatible web server
  4. Set UseWebSocket = false in FriendManagerSettings
  5. Set ServerUrl to your PHP server's URL
  6. Send X-User-Id header with all requests (see PHP documentation)

Connecting the UI

Using the Included Prefabs

The fastest way to add friend UI to your game:

  1. Drag Prefabs/FriendListUI.prefab into your scene
  2. The prefab has a FriendListUI component attached
  3. Find the Friend Manager field in the Inspector
  4. Assign your FriendManager or FriendManagerInitializer object
  5. The UI will automatically connect and display friends

UI Components Available

PrefabUse Case
FriendListUI.prefabComplete friend list panel with tabs
FriendListItem.prefabSingle friend row for lists
FriendRequestItem.prefabFriend request row
InvitationItem.prefabGame invitation row
BlockedUserItem.prefabBlocked user row

Next Steps

For Non-Developers

Now that you have a working friend list, you can customize it using the inspector:

  • Adjust RefreshInterval to control how often lists update
  • Set MaxFriends and MaxBlockedUsers limits
  • Enable PersistFriendList to save friends between game sessions
  • Use UnityEvents to connect UI elements without code
  • Explore the Game Type system for room invitations

For Developers

Dive deeper into the system architecture: