Back to search
ExampleGameplay

Create a Blueprint for a door that opens when the player overlaps a trigger and closes when they leave

Updated 3mo ago
UE 5.0UE 5.1UE 5.2UE 5.3UE 5.4UE 5.5UE 5.6UE 5.7#door#open#close#trigger#overlap#timeline#beginner

Blueprint JSON

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

{
  "nodes": [
    {
      "id": "n_begin_overlap",
      "position": {
        "x": 0,
        "y": 0
      },
      "node_type": "OnComponentBeginOverlap",
      "component_name": "TriggerBox"
    },
    {
      "id": "n_timeline",
      "tracks": [
        {
          "keys": [
            {
              "time": 0,
              "value": 0
            },
            {
              "time": 1,
              "value": 1
            }
          ],
          "name": "DoorAlpha",
          "type": "float"
        }
      ],
      "position": {
        "x": 300,
        "y": 0
      },
      "node_type": "Timeline",
      "timeline_name": "DoorTimeline"
    },
    {
      "id": "n_end_overlap",
      "position": {
        "x": 0,
        "y": 300
      },
      "node_type": "OnComponentEndOverlap",
      "component_name": "TriggerBox"
    },
    {
      "id": "n_get_angle",
      "position": {
        "x": 400,
        "y": 200
      },
      "node_type": "GetVariable",
      "variable_name": "OpenAngle"
    },
    {
      "id": "n_lerp",
      "position": {
        "x": 600,
        "y": 100
      },
      "node_type": "Lerp",
      "input_values": {
        "A": "0.0"
      }
    },
    {
      "id": "n_makerot",
      "position": {
        "x": 800,
        "y": 100
      },
      "node_type": "MakeRotator"
    },
    {
      "id": "n_setrot",
      "position": {
        "x": 1000,
        "y": 0
      },
      "node_type": "SetRelativeRotation",
      "target_component": "DoorMesh"
    }
  ],
  "variables": [
    {
      "name": "OpenAngle",
      "type": "float",
      "default_value": "90.0"
    }
  ],
  "components": [
    {
      "name": "DoorFrame",
      "type": "StaticMeshComponent",
      "is_root": true
    },
    {
      "name": "DoorMesh",
      "type": "StaticMeshComponent",
      "parent": "DoorFrame"
    },
    {
      "name": "TriggerBox",
      "type": "BoxComponent",
      "parent": "DoorFrame",
      "properties": {
        "BoxExtent": {
          "X": 200,
          "Y": 200,
          "Z": 100
        },
        "CollisionProfileName": "OverlapOnlyPawn",
        "GenerateOverlapEvents": true
      }
    }
  ],
  "connections": [
    {
      "to_pin": "Play from Start",
      "to_node": "n_timeline",
      "from_pin": "then",
      "from_node": "n_begin_overlap"
    },
    {
      "to_pin": "Reverse from End",
      "to_node": "n_timeline",
      "from_pin": "then",
      "from_node": "n_end_overlap"
    },
    {
      "to_pin": "execute",
      "to_node": "n_setrot",
      "from_pin": "Update",
      "from_node": "n_timeline"
    },
    {
      "to_pin": "Alpha",
      "to_node": "n_lerp",
      "from_pin": "DoorAlpha",
      "from_node": "n_timeline"
    },
    {
      "to_pin": "B",
      "to_node": "n_lerp",
      "from_pin": "OpenAngle",
      "from_node": "n_get_angle"
    },
    {
      "to_pin": "Yaw",
      "to_node": "n_makerot",
      "from_pin": "ReturnValue",
      "from_node": "n_lerp"
    },
    {
      "to_pin": "NewRotation",
      "to_node": "n_setrot",
      "from_pin": "ReturnValue",
      "from_node": "n_makerot"
    }
  ],
  "parent_class": "Actor",
  "blueprint_name": "BP_Door"
}