Skip to content

Instantly share code, notes, and snippets.

@hobione2k
Last active March 22, 2024 20:16
Show Gist options
  • Save hobione2k/6bd6765a8c4ec17e44352e5303c95137 to your computer and use it in GitHub Desktop.
Save hobione2k/6bd6765a8c4ec17e44352e5303c95137 to your computer and use it in GitHub Desktop.
ClusterScript Beta Overlapプレイヤーを取得
const dedupPlayer = (players) =>
players.filter((p, i) => players.findIndex((p2) => p2.id == p.id) === i);
const activePlayer = (players) =>
players.filter((p) => p != null && p.exists());
const getOverlapsPlayer = () => {
// getOverlaps()から有効なプレイヤーだけ取得
const overlaps = $.getOverlaps();
const players = overlaps.map((o) => o.object.playerHandle);
return dedupPlayer(activePlayer(players));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment