Verse Library verse

12 Translating Prop Verse

Defines a reusable class inheriting from movable prop to handle translation toward targets or positions.

extracted-snippets/documentation/en-us/uefn/animating-prop-movement-3-translating-props-in-verse/12-translating-prop-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/animating-prop-movement-3-translating-props-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/animating-prop-movement-3-translating-props-in-verse.md
# Section:    translating\_prop.verse
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/CreativeAnimation }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

MovePositionTip<localizes>:message = "The optional position to move to World Space. Use this if you do not want to set a MoveTarget."

# A prop that moves (translates) towards either a creative prop target
# or a position in world space.
translating_prop<public> := class<concrete>(movable_prop):

    # The creative prop targets for the RootProp to move towards.
    @editable {ToolTip := MoveTargetsTip}
    var MoveTargets:[]creative_prop = array{}

    # The optional position for the RootProp to move towards. Use this if you
    # do not want to set a MoveTarget.
    @editable {ToolTip := MovePositionTip}
    var MovePosition:?vector3 = false

    # The position the prop is currently targeting.
    var TargetPosition:vector3 = vector3{}

    # Translate the RootProp towards the MoveTarget, or MovePosition if one is set.
    Move<override>()<suspends>:void=

        # Set the TargetPosition to the MovePosition if it is set.

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