Searches for online player by username. This is case sensitive. For a more lenient username search see FindByFuzzySearch.
Target username -- this must match the player's username exactly.
An online player with matching username if one exists, otherwise undefined.
Gets a user's profile picture as Texture2D.
Id of user you want to get profile picture of. This player doesn't need to be online.
If true this function will return values cached locally. This is usually preferable
unless you need to guarantee the most up-to-date profile picture. Defaults to true
.
A Texture2D of the profile picture. If this function fails to fetch the profile picture or it doesn't exist it will return the default profile picture for the user.
Private
InitObserve every player entering/leaving the game. The returned function can be called to stop observing.
Function fired for every player currently in the game and
every future player that joins. The observer
function must return another
function which is called when said player leaves (or the top-level observer
function was called to stop the observation process).
Airship.players.ObservePlayers((player) => {
print(`${player.name} entered`);
return () => {
print(`${player.name} left`);
};
});
Optional
signalPriority: SignalPriorityDisconnect function -- call to stop observing players and call the cleanup function on each.
Waits for player by connectionId. This is only useful if you are working with a connection id before a player has been added. A player is added when the client loads the starting scene. On client your local player will exist immediately.
The connection id to wait for
How long (in seconds) to stop waiting for this player.
Player with connectionId if found, otherwise undefined after timeout.
Access using Airship.Players. Players singleton allows you to work with currently connected clients (with Airship's Player object).
If you are looking to get information about offline users see AirshipUserController