質問です。UEFNのダメージボリュームを開始時に表示をOFF、NPCキャラクター定義で作成したBossキャラのHPが800以下になったら、表示をONにする設定がうまくいきません。わかる方はいらっしゃいますか?
I’m having trouble setting up a damage volume in UEFN. I want it to be hidden at the start of the game and then become visible when a boss character, created from an NPC character definition, has its HP drop below 800. Does anyone know how to do this?
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
damage_controller := class():
@editable
DamageVolume : damage_volume_device = damage_volume_device{}
@editable
BossCharacter : creative_character_device = creative_character_device{}
var BossHealth : health_component = health_component{}
OnBegin<override>() : void =
spawn:
# Boss のヘルスを取得
BossHealth = BossCharacter.GetHealthComponent[]
loop:
if (BossHealth.GetCurrentHealth[] < 800.0):
# HPが800未満なら ON
DamageVolume.Enable()
Print("DamageVolume: ON (Boss HP < 800)")
else:
# それ以外なら OFF
DamageVolume.Disable()
Print("DamageVolume: OFF (Boss HP >= 800)")
Sleep(1.0) # 1秒ごとにチェック