using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random }
using { /Fortnite.com/Devices/CreativeAnimation }
using { /Fortnite.com/Devices/CreativeAnimation/InterpolationTypes }
movment_demo := class(creative_device):
@editable var Prop : creative_prop = creative_prop{}
@editable var Wall : creative_prop = creative_prop{}
@editable var MinPosition : float = 0.0
@editable var MaxPosition : float = 0.0
var IsMovingRight : logic = true
@editable var MoveSpeed : float = 2.0
OnBegin<override>()<suspends>:void=
var CurrentTransform : transform = Prop.GetTransform()
var NewX : float = CurrentTransform.Translation.Y
spawn:
MoveProp()
MoveProp()<suspends>:void =
Sleep(0.2)
var CurrentTransform : transform = Prop.GetTransform()
loop:
var NewX : float = CurrentTransform.Translation.X
if (IsMovingRight?):
set NewX += MoveSpeed
else:
set NewX -= MoveSpeed
if (NewX >= MaxPosition):
set NewX = MaxPosition
set IsMovingRight = false
else if (NewX <= MinPosition):
set NewX = MinPosition
set IsMovingRight = true
var NewPosition : vector3 = vector3{
X := NewX,
Y := CurrentTransform.Translation.Y,
Z := CurrentTransform.Translation.Z
}
set CurrentTransform = transform{
Translation := vector3{
X := NewX,
Y := CurrentTransform.Translation.Y,
Z := CurrentTransform.Translation.Z
},
Rotation := CurrentTransform.Rotation,
Scale := CurrentTransform.Scale
}
spawn:
Prop.MoveTo(NewPosition, CurrentTransform.Rotation, 0.1)
Sleep(0.01)