Use Followers In-Game
In this How-to, we will implement a basic Followers system in-game using LootLocker. You will learn how to show who follows a player, who they are following, allow players to follow/unfollow others, and build simple UI patterns like profile headers, lists, and follow buttons.
Prerequisites
Multiple player profiles (e.g. create via separate sessions)
(Optional) Some player ULIDs collected from the Player Manager
(Optional) Familiarity with managing relationships in the Web Console
Followers vs Friends
Followers are a one‑way relationship. Player A can follow Player B without approval (unless B has blocked A). This enables:
Creator / influencer style player profiles
Social feeds or “What your followed players did”
Asynchronous competitions (e.g. “Chase the ghost of players you follow”)
Notification or highlight surfaces (e.g. “New level published by someone you follow”)
If you need mutual, opt‑in relationships, use Friends instead (see: Use Friends in Game).
Core Concepts
Followers list: Players who follow the target player.
Following list: Players the target player has chosen to follow.
Pagination: Large lists return a
next_cursor; request subsequent pages until empty.Blocking: A blocked player cannot follow or become friends with the blocker.
UI Caching: Cache following IDs locally to render instant button states (“Following” vs “Follow”).
Typical UX Flow
Open Profile (self or another player)
Fetch counts (followers + following) for header display
Lazy-load the tab the player opens first (e.g. “Following”)
Infinite scroll / “Load more” using cursor
Show Follow / Unfollow button with optimistic state change
Update local cache + optionally refresh counts
Fetch Follower and Following Lists
Use these to populate tabs or modals.
Coming soon...
Coming soon...
Pagination Strategy
Always request the first page with no cursor.
Store
next_cursorif present.Disable “Load more” when cursor is empty or null.
Consider prefetching the next page when the user scrolls past 70% of current content.
Displaying Counts
Instead of loading entire lists to show numbers, use the first page response (which includes total/size fields) or lazily populate counts after the first fetch. If exact counts are not required immediately, show placeholders (e.g. “—” then fade in).
Coming soon...
Coming soon...
Follow a Player
Trigger from a profile card, leaderboard row, chat user badge, or “Suggested Players” carousel.
Coming soon...
Coming soon...
Optimistic Updates
Disable the button and swap label to “Following…”
Send follow request
On success: set to “Following” (or icon toggle)
On failure: revert and show a subtle toast
Unfollow a Player
Offer this option from the “Following” list or a context / overflow menu.
Coming soon...
Coming soon...
Confirmation Pattern
Use lightweight confirmations only if unfollow has downstream impact (e.g. curated feed). Otherwise allow instant toggle with an Undo snackbar.
Determining If Current Player Follows Target
To check if the logged-in player follows a specific other player you do NOT need to build or hydrate a full cache. Use the single-item pagination shortcut: call the following-list endpoint with the target player's public UID as the cursor (or path parameter depending on SDK variant) and request Count: 1. If one entry is returned, the relationship exists; if zero, it does not.
Why this works: the server returns the players the current player is following starting “from” the supplied cursor (player ULID). Asking for only one result lets the backend tell you immediately if that specific ID is in the set without scanning client‑side.
Pros:
O(1) network request per check (no growing local data structure)
Constant payload size (either 0 or 1 item)
Always fresh (no stale cache issues)
Consider caching only if you batch many checks in the same frame (e.g. rendering 100 profile tiles). For a single profile view, prefer this direct probe.
Coming soon...
Coming soon...
Performance Tips
Debounce rapid follow toggles (e.g. leaderboards) to one in-flight request per target.
Paginate aggressively (e.g. 25–50 per page) for scrolling lists.
Preload the first page of “Following” at session start if many UI surfaces need that state.
Avoid full refresh after each follow action; surgically mutate local structures.
Example Feature Ideas
Activity Feed: Show recent achievements of players you follow.
“Players Following This Creator Also Follow…” recommendations (intersect follower sets).
Seasonal Follow Goals: Reward cosmetics when a player reaches follower milestones.
Conclusion
In this How-to we listed followers, listed who a player is following, implemented follow/unfollow actions, handled pagination, and optimized UI responsiveness with caching and optimistic updates. You can now extend this to social feeds, recommendations, or creator-style profile experiences. Next, explore adding Friends or managing relationships in the Web Console.
Last updated