ボタンを押してキャラクターを躍らせる!

要件

  1. ボタンの仕掛けを設置する
  2. キャラクターの仕掛けを設置する
  3. ボタンの仕掛けをインタラクトすると、キャラクターの仕掛けがエモートする

必要な仕掛け

  1. ボタンの仕掛け(x1)
  2. キャラクターの仕掛け(x1)

回答

回答を見る
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

press_button_to_emote_device := class(creative_device):
    @editable
    ButtonDevice:button_device = button_device{}
    @editable
    CharacterDevice:character_device = character_device{}

    OnBegin<override>()<suspends>:void=
        ButtonDevice.InteractedWithEvent.Subscribe(OnInteract)

    OnInteract(Agent:agent):void=
        CharacterDevice.PlayEmote()

チャレンジ

チャレンジを見る

実はキャラクターの仕掛け自身にもインタラクトの機能が備わっています。今回はボタンからエモートの再生を行いましたが、キャラクター自信をインタラクトしてエモート再生も挑戦してみましょう。うまくインタラクトできない場合は、キャラクターの仕掛けの設定とかも見直してみるとよいかもしれません。

要件

  1. キャラクターの仕掛けを設置する
  2. キャラクターの仕掛けをインタラクトするとエモートする

必要な仕掛け

  1. キャラクターの仕掛け(x1)

回答

回答を見る
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

press_button_to_emote_device := class(creative_device):
    @editable
    CharacterDevice:character_device = character_device{}

    OnBegin<override>()<suspends>:void=
        CharacterDevice.InteractedWithEvent.Subscribe(OnInteract)

    OnInteract(Agent:agent):void=
        CharacterDevice.PlayEmote()