コインを取ってテレポート!

要件

  1. コレクティブルオブジェクトを設置する
  2. テレポーターを離れた位置に設置する
  3. コレクティブルオブジェクトを取得するとテレポーターに転送される

使用する仕掛け

  1. コレクティブルオブジェクトの仕掛け(x1)
  2. テレポーターの仕掛け(x1)

回答

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

collect_coin_and_teleport_device := class(creative_device):
    @editable
    CollectibleObjectDevice:collectible_object_device = collectible_object_device{}
    @editable
    TeleporterDevice:teleporter_device = teleporter_device{}

    OnBegin<override>()<suspends>:void=
        CollectibleObjectDevice.CollectedEvent.Subscribe(OnCollect)

    OnCollect(Agent:agent):void=
        TeleporterDevice.Teleport(Agent)