Verse Library verse

29 Movement Behaviors Verse

Defines animation easing enums and convenience methods to move creative props with specific interpolation curves.

extracted-snippets/documentation/en-us/uefn/animating-prop-movement-6-combining-movement-rotation-and-scale-in-verse/29-movement-behaviors-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/animating-prop-movement-6-combining-movement-rotation-and-scale-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/animating-prop-movement-6-combining-movement-rotation-and-scale-in-verse.md
# Section:    movement\_behaviors.verse
# This file stores functions common to animating Creative props using keyframes.
# It also defines the move_to_ease_type enum to help in building animations.

using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Characters}
using { /Fortnite.com/Devices/CreativeAnimation }

# Represents the different movement easing types.
move_to_ease_type<public> := enum {Linear, Ease, EaseIn, EaseOut, EaseInOut}

# Return the cubic_bezier_parameters based on the given move_to_ease_type.
GetCubicBezierForEaseType(EaseType:move_to_ease_type):cubic_bezier_parameters=
    case (EaseType):
        move_to_ease_type.Linear => InterpolationTypes.Linear
        move_to_ease_type.Ease => InterpolationTypes.Ease
        move_to_ease_type.EaseIn => InterpolationTypes.EaseIn
        move_to_ease_type.EaseOut => InterpolationTypes.EaseOut
        move_to_ease_type.EaseInOut => InterpolationTypes.EaseInOut

# Initializes a vector3 with all values set to 1.0.
VectorOnes<public>:vector3 = vector3{X:=1.0, Y:=1.0, Z:=1.0}

# An overload of MoveToEase() that changes the position of the prop while keeping the rotation and scale the same.
(CreativeProp:creative_prop).MoveToEase<public>(Position:vector3, Duration:float, EaseType:move_to_ease_type, AnimationMode:animation_mode)<suspends>:void=
    CreativeProp.MoveToEase(Position, IdentityRotation(), VectorOnes, Duration, EaseType, AnimationMode)

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in