エモートは、どんな社会的経験のコアコンポーネントです。The エモートバー 開発者モジュール は、プレイヤーにアクセシブルでカスタマイズ可能な方法を提供し、意味のあるソーシャルインタラクションを促進することを目的としています。
モジュールの使用
インストール
エクスペリエンスで エモートバー モジュールを使用するには:
ビュータブから、ツールボックスを開き、クリエイターストアタブを選択します。
モデル の順序が選択されていることを確認し、 すべて表示 ボタンをクリックして、 カテゴリ を選択します。
ロケートしてクリックして 開発モジュール タイル。
エモートバー モジュールを見つけてクリックするか、3D ビューにドラッグアンドドロップします。
エクスプローラー ウィンドウで、 EmoteBar モデル全体を ServerScriptService に移動します。エクスペリエンスを実行すると、モジュールは複数のサービスに分配され、実行を開始します。
構成
モジュールは 7 のエモートでプリコンフィグされており、独自のエモートと表示オプションで簡単にカスタマイズできます。さらに、プレイヤーが以前の Roblox イベント (Lil Nas X、Royal Blood、または Twenty One Pilots など) からのエモートを所有している場合、それらのエモートは自動的に利用可能なエモートのリストに追加されます。
In ServerScriptService で、新しい Script を作成し、名前を Emotes 構成する に変更します。
新しい コンファイアエモート スクリプトに次のコードを貼り付け。The useDefaultEmotes 設定の false はデフォルトのエモートを上書きし、setEmotes 関数を通じてカスタムエモートを定義できます。
スクリプト - ConfigureEmoteslocal ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureServer({useDefaultEmotes = false,})EmoteBar.setEmotes({{name = "Hello",animation = "rbxassetid://3344650532",image = "rbxassetid://7719817462",defaultTempo = 1,},{name = "Applaud",animation = "rbxassetid://5915693819",image = "rbxassetid://7720292217",defaultTempo = 2,},})
メガエモート
同じ領域にいる複数のプレイヤーが同時に同じエモートを行うと、 メガエモート が形成されます。より多くのプレイヤーが参加するにつれて、メガエモートは大きくなります。プレイヤーがエモートを停止すると、メガエモートは最終的に消えるまで小さくなります。

テンポ
エモーリアクションの テンポ は、ボタンがタップされると再生する速度です。エモートのデフォルト速度は、その defaultTempo によって決まります。エモートの速度は、ボタンをより速くまたは遅くタップすることで増加または減少できます。
API リファレンス
タイプ
エモート
それぞれのエモートは、次のキー-バリューペアで構成される辞書で表現されます:
キー | 種類 | 説明 |
---|---|---|
name | 文字列 | 例えば、エモート名 "Shrug" 。 |
animation | 文字列 | エモートのアニメーションのアセットID。 |
image | 文字列 | GUI のエモート画像のアセットID。 |
defaultTempo | 番号 | エモートアニメーションを再生するデフォルトの速度要素。たとえば、2のテンポは、通常の速度の 2 倍の速度でアニメーションを再生します。0より大きくなければなりません。 |
isLocked | bool | エモートが有効になるのを「ロック」するかどうか。 |
枚数
エモートバー.GuiType
名前 | 概要 |
---|---|
EmoteBar | 画面の下部に表示されるエモートのデフォルトフォーム、個々の「ページ」に分割されます。 |
EmoteWheel | プレイヤーがプレイヤーキャラクターをクリックまたはタップすると、リングにエモートが表示されるバリアント。 |
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureClient({guiType = EmoteBar.GuiType.EmoteWheel,})
機能
configuredサーバー
configureServer(config: table )
次のキー/値を使用して、デフォルトのサーバー側の構成オプションをオーバーライドし、config テーブルの中の。この機能は Script からのみ呼び出すことができ、変更は自動的にすべてのクライアントにレプリケートされます。
キー | 説明 | デフォルト |
---|---|---|
useDefaultEmotes | 提供されたデフォルトのエモートが含まれるかどうか。 | 真 |
useMegaEmotes | メガエモート 機能を有効化/無効化します。 | 真 |
emoteMinPlayers | メガエモートに貢献するため、同じエモーリアクションを実行するプレイヤーの最小数 | 3 |
emoteMaxPlayers | メガエモートに貢献する同じエモートを実行するプレイヤーの最大数 | 50 |
playParticles | プレイヤーが頭上で浮かぶ粒子として演奏するエモートを有効化/無効化します。 | 真 |
sendContributingEmotes | メガエモートに貢献するために、小さなエモートアイコンを送信することを有効化または無効化します。 | 真 |
スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureServer({emoteMinPlayers = 2,playParticles = false,})
client を構成する
configureClient(config: table )
次のキー/値を使用して、デフォルトのクライアント側構成オプションをオーバーライドし、config テーブルの中の。この機能は LocalScript からのみ呼び出すことができます。guiType の値によって、注目されたタブのオプションも適用されます。
キー | 説明 | デフォルト |
---|---|---|
guiType | GUI を構成するコントロールは、エモートを表示するために使用します (EmoteBar.GuiType )。 | Emoteバー |
useTempo | ユーザーが同じエモートをリズミカルに複数回再起動することで、エモートの速度や遅度を制御できる テンポ 機能を有効化/無効化します。 | 真 |
tempoActivationWindow | 秒単位で、ユーザーがエモートの連続起動の間に持っている時間の量は、テンポの一部としてカウントされます。 | 3 |
lockedImage | 上部にロックされたエモートを表示する画像。 | 「rbxassetid://6905802778」 |
ローカルスクリプト - Emote Bar
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureClient({guiType = EmoteBar.GuiType.EmoteBar,maxEmotesPerPage = 6,nextPageKey = Enum.KeyCode.Z,prevPageKey = Enum.KeyCode.C,})
ローカルスクリプト - エモートホイール
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureClient({guiType = EmoteBar.GuiType.EmoteWheel,})
セットエモート
setEmotes(emotes: table )
使用するカスタムエモートを設定します。これらは、useDefaultEmotes が true である場合、デフォルトに追加され、useDefaultEmotes が false である場合、デフォルトを置き換えます。この機能は Script からのみ呼び出すことができ、変更は自動的にすべてのクライアントにレプリケートされます。
この機能に渡された各エモートの構造については、エモート を参照してください。
スクリプト - ConfigureEmotes
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.configureServer({useDefaultEmotes = false,})EmoteBar.setEmotes({{name = "Hello",animation = "rbxassetid://3344650532",image = "rbxassetid://7719817462",defaultTempo = 1,},{name = "Applaud",animation = "rbxassetid://5915693819",image = "rbxassetid://7720292217",defaultTempo = 2,},})
設定GUIビジビリティ
setGuiVisibility(visible: boolean )
エモート GUI を表示または非表示にします。この機能は、特定のクライアントの LocalScript からのみ呼び出すことができます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.setGuiVisibility(false)
ゲットエモート
名前で エモート を取得する。エモートが見つからない場合は nil を返します。この機能は、特定のクライアントの LocalScript からのみ呼び出すことができます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))local shrug = EmoteBar.getEmote("Shrug")
emoteを再生
playEmote(emote: エモート )
指定された エモート を再生し、接続されている場合は、サーバー上で emotePlayed イベントを発動します。この機能は、特定のクライアントの LocalScript からのみ呼び出すことができます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))local shrug = EmoteBar.getEmote("Shrug")EmoteBar.playEmote(shrug)
ロックエモート
lockEmote(emoteName: string )
エモート を指定された名前でロックします。この機能は、クライアント上の LocalScript からのみ呼び出すことができます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.lockEmote("Applaud")
エモートをアンロック
emoteをアンロック(emoteName: string )
指定された名前で エモート をアンロックします。この機能は、クライアントの LocalScript からのみ呼び出すことができます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))EmoteBar.unlockEmote("Applaud")
イベント
emoteプレイ済み
クライアントがエモートを再生するときに発火します。このイベントは LocalScript でのリアクション接続できます。
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))
EmoteBar.emotePlayed:Connect(function(player, emote)
print(player.Name, "played", emote.name)
end)
ロックされたエモートアクティブ化
クライアントがロックされたエモートをクリックしたときに発火します。このイベントは LocalScript でのみ接続できます。
パラメータ | |
---|---|
emote: エモート | 有効になったロックされたエモート。 |
本地スクリプト
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local EmoteBar = require(ReplicatedStorage:WaitForChild("EmoteBar"))
EmoteBar.lockedEmoteActivated:Connect(function(emote)
print(Players.LocalPlayer, "clicked", emote.name)
end)