LoginSignup
0
0

【UEFN】Verseで消せないDeviceを消す方法

Posted at

背景

何かをクリアした条件にダメージボリュームデバイスを消したかったのですが非表示にするようなメソッドを持ち合わせていませんでした。そこでどのようにやるか考え始めました。
image.png

解決方法

非表示にしたと見せかけるように遠くにテレポートさせるという方法で解決しました。

動画

実装

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }<-忘れずに追加して

hide_creative_device := class(creative_device):

    @editable
    Trigger:trigger_device=trigger_device{}

    @editable
    damageVolume:damage_volume_device=damage_volume_device{}

    OnBegin<override>()<suspends>:void=
        Trigger.TriggeredEvent.Subscribe(HideDevice)

    HideDevice(QAgent : ?agent):void=
        NewRotation := rotation{}
        vec := vector3{X:=10000.0, Y:=10000.0, Z:=0.0}
        if(damageVolume.TeleportTo[vec, NewRotation]):

やっていること

トリガーを押したら遠くへテレポートさせて消えたように見せかけています。

        NewRotation := rotation{}
        vec := vector3{X:=10000.0, Y:=10000.0, Z:=0.0}
        if(damageVolume.TeleportTo[vec, NewRotation]):

テレポートした先での向きとその位置を指定しています。Teleportを呼ぶときは必ずif():で囲ってください。

忘れずに追加しましょう!

using { /UnrealEngine.com/Temporary/SpatialMath }

まとめ

まだまだVerceも成長している途中で欲しいと思った機能がないことがあるのであの手この手で実装する必要がありそうですね。

余談

この度UEFN/Verseに関するオープンコミュニティサーバーを建ち上げました。ちょっとでも興味があれば奮ってご参加くださいませ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0