🐳

[UEFN][Fall Guys]回転する足場のコード

2024/08/11に公開

できること

Fall Guysで今後多用するであろう回転するプロップ

コード全文


using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Devices/CreativeAnimation }
using { /UnrealEngine.com/Temporary/SpatialMath }

PropMove_device := class(creative_device):
    @editable
    Props : []PropandMoveTime = array{}

    OnBegin<override>()<suspends>:void=
        for(Prop:Props):
            spawn{PlayAnimation(Prop)}
        return
    
    PlayAnimation(Prop:PropandMoveTime)<suspends>:void =
        if:
            AnimationController := Prop.MoveProp.GetAnimationController[]
        then:
            loop:
                var KeyFrames : []keyframe_delta = array {}
                #CurrentLocation := MoveProp.GetTransform().Translation
                #CurrentRotation := MoveProp.GetTransform().Rotation
                set KeyFrames += array:
                    keyframe_delta :
                                DeltaLocation := vector3{X:=0.0,Y:=0.0,Z:=0.0}
                                DeltaRotation := MakeRotationFromYawPitchRollDegrees(90.0, 0.0, 0.0)
                                Time := Prop.RotateTime
                AnimationController.SetAnimation(KeyFrames, ?Mode:=animation_mode.OneShot)
                AnimationController.Play()
                Sleep(0.0)
        return

PropandMoveTime<public> := class<concrete>:
    @editable
    MoveProp : creative_prop = creative_prop{}
    @editable
    RotateTime : float = 1.0

参考URL

https://ringogames.hatenablog.com/entry/2023/05/27/133710
(いつも勉強させていただいています)

課題

  1. なにかありましたらコメント or Xでお願いします

Discussion