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
- Photon PUN projects → Select
- 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
UserIdonFriendManagerInitializeror callFriendManager.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:
- Navigate to
.Server/websocket/in the package - Open a terminal in that folder
- Run
npm install - Run
npm start - The server starts at
http://localhost:3001 - Set
UseWebSocket = truein FriendManagerSettings - Set
ServerUrl = http://localhost:3001 - Set
WebSocketUrl = ws://localhost:3001/ws
PHP Server (Simple REST)
For simpler hosting or shared servers, use the PHP backend:
- Navigate to
.Server/php/in the package - Configure
config.phpwith your database settings - Host the folder on a PHP-compatible web server
- Set
UseWebSocket = falsein FriendManagerSettings - Set
ServerUrlto your PHP server's URL - Send
X-User-Idheader with all requests (see PHP documentation)
Connecting the UI
Using the Included Prefabs
The fastest way to add friend UI to your game:
- Drag
Prefabs/FriendListUI.prefabinto your scene - The prefab has a
FriendListUIcomponent attached - Find the
Friend Managerfield in the Inspector - Assign your
FriendManagerorFriendManagerInitializerobject - The UI will automatically connect and display friends
UI Components Available
| Prefab | Use Case |
|---|---|
FriendListUI.prefab | Complete friend list panel with tabs |
FriendListItem.prefab | Single friend row for lists |
FriendRequestItem.prefab | Friend request row |
InvitationItem.prefab | Game invitation row |
BlockedUserItem.prefab | Blocked user row |
Next Steps
For Non-Developers
Now that you have a working friend list, you can customize it using the inspector:
- Adjust
RefreshIntervalto control how often lists update - Set
MaxFriendsandMaxBlockedUserslimits - Enable
PersistFriendListto 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:
- Read FriendManager documentation for all available methods
- Explore IFriendManager API for the interface contract
- Learn about Game Types to customize invitation behavior
- Check Network Integration for backend-specific details
- Review Server Setup for deployment guides