# This is the full color_chaser creative_device. # It wires together the struct, the prop, and the logic. using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Colors } using { /UnrealEngine.com/Temporary/SpatialMath } MyHeroInfo := struct: Name : string HeroColor : color color_chaser := class(creative_device): # Wire this to a prop_device placed in the editor. MeshProp : prop_device = prop_device{} # Default hero data; override values in the editor # Details panel or change them in OnBegin below. var Info : MyHeroInfo = MyHeroInfo{ Name := "Builder", HeroColor := NamedColors.Red } OnBegin() : void = # Log the hero's name to the output window. Print("Hello, {Info.Name}!") # Move the prop to a target position as a demo. # Adjust the vector3 values for your island layout. MoveToTarget(vector3{X := 100.0, Y := 0.0, Z := 0.0}) MoveToTarget(Target : vector3) : void = loop: CurrentTransform := MeshProp.GetTransform() CurrentPos := CurrentTransform.Translation Distance := distance(CurrentPos, Target) if (Distance < 5.0): break NewPos := Lerp(CurrentPos, Target, 0.1) MeshProp.MoveTo( transform{ Translation := NewPos, Rotation := CurrentTransform.Rotation, Scale := CurrentTransform.Scale }, 0.01 ) Sleep(0.01)