How to use animated_mesh_device
Ai-Symbol Generated

How to use animated_mesh_device

Updated Generated

How would I use this?

The animated_mesh_device is your bridge between static props and dynamic, skeletal animations in UEFN. It allows you to attach a skeletal mesh to a device and control its playback state (Play, Pause, Reverse) and timing (Play Rate) via Verse.

What it's for

Use this when you need a prop (like a statue, a dancing NPC, or a mechanical part) to perform an animation that isn't baked into the static mesh itself. Unlike creative_prop, which just displays a static image or simple skeletal mesh without control, animated_mesh_device exposes methods to drive the animation timeline programmatically.

When to reach for it

  • Interactive Props: You want a statue to start dancing when a player steps on a trigger.
  • Sequenced Events: You are building a cinematic or a trap that requires a specific animation frame or loop to sync with audio or other devices.
  • State-Driven Animation: You need to pause an animation mid-way, reverse it, or change its speed (e.g., a fan speeding up or slowing down).

Typical Call Pattern

  1. Declare the Device: Add an @editable field of type animated_mesh_device to your creative_device class.
  2. Wire in Editor: Place the device on your island, assign the desired Skeletal Mesh and Animation in the device's details panel, and wire this Verse device to it in the User Options.
  3. Control Playback:
    • Call Play() to start or resume the animation.
    • Call Pause() to freeze the animation on the current frame.
    • Call PlayReverse() to play backwards.
    • Call SetPlayRate(float) to change the speed (e.g., 2.0 for double speed).

Faithful Verse Snippet

Here is a concrete example of a device that starts an animation and then changes its speed when triggered.

DanceDevice := class(creative_device):

    # Reference to the Animated Mesh Device placed on the island.
    @editable
    AnimatedMesh : animated_mesh_device = animated_mesh_device{}

    # Reference to the Trigger Device placed on the island.
    @editable
    DanceTrigger : trigger_device = trigger_device{}

    # Variable to control speed
    var speed_variable : float = 1.0

    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger so OnTriggered runs when a player hits it.
        DanceTrigger.TriggeredEvent.Subscribe(OnTriggered)

        # Start the animation at normal speed immediately
        AnimatedMesh.Play()

    OnTriggered(Agent : ?agent) : void =
        # Change the speed variable to double speed
        set speed_variable = 2.0

        # Apply the new speed to the animation
        AnimatedMesh.SetPlayRate(speed_variable)

Turn this into a guided course

Add animated_mesh_device to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.

Original ai-symbol generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.

Comments

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