Back to search
ExampleAnimation

Create a Blueprint Actor with a timeline that smoothly interpolates between two locations over 2 seconds

Updated 3mo ago
UE 5.4UE 5.7#timeline#interpolation#movement#lerp

Blueprint JSON

The structure WoalzCraft generates. Paste into the plugin to instantiate as a real Blueprint.

{
  "nodes": [
    {
      "id": "n_begin",
      "position": {
        "x": 0,
        "y": 0
      },
      "node_type": "EventBeginPlay"
    },
    {
      "id": "n_getloc",
      "position": {
        "x": 200,
        "y": 100
      },
      "node_type": "GetActorLocation"
    },
    {
      "id": "n_set_start",
      "position": {
        "x": 400,
        "y": 0
      },
      "node_type": "SetVariable",
      "variable_name": "StartLocation"
    },
    {
      "id": "n_timeline",
      "tracks": [
        {
          "keys": [
            {
              "time": 0,
              "value": 0
            },
            {
              "time": 2,
              "value": 1
            }
          ],
          "name": "Alpha",
          "type": "float"
        }
      ],
      "position": {
        "x": 600,
        "y": 0
      },
      "node_type": "Timeline",
      "timeline_name": "MoveTimeline"
    },
    {
      "id": "n_lerp",
      "position": {
        "x": 900,
        "y": 100
      },
      "node_type": "CallFunction",
      "function_name": "VLerp"
    },
    {
      "id": "n_setloc",
      "position": {
        "x": 1100,
        "y": 0
      },
      "node_type": "SetActorLocation"
    }
  ],
  "variables": [
    {
      "name": "StartLocation",
      "type": "Vector"
    },
    {
      "name": "EndLocation",
      "type": "Vector"
    },
    {
      "name": "Duration",
      "type": "float",
      "default_value": "2.0"
    }
  ],
  "connections": [
    {
      "to_pin": "execute",
      "to_node": "n_set_start",
      "from_pin": "then",
      "from_node": "n_begin"
    },
    {
      "to_pin": "StartLocation",
      "to_node": "n_set_start",
      "from_pin": "ReturnValue",
      "from_node": "n_getloc"
    },
    {
      "to_pin": "Play from Start",
      "to_node": "n_timeline",
      "from_pin": "then",
      "from_node": "n_set_start"
    },
    {
      "to_pin": "execute",
      "to_node": "n_setloc",
      "from_pin": "Update",
      "from_node": "n_timeline"
    },
    {
      "to_pin": "Alpha",
      "to_node": "n_lerp",
      "from_pin": "Alpha",
      "from_node": "n_timeline"
    },
    {
      "to_pin": "NewLocation",
      "to_node": "n_setloc",
      "from_pin": "ReturnValue",
      "from_node": "n_lerp"
    }
  ],
  "parent_class": "Actor",
  "blueprint_name": "BP_SmoothMover"
}