Back to search
ExampleGameplay

Create a Blueprint Actor for a collectible coin that rotates, plays a sound, and adds score when picked up

Updated 6mo ago2 look-ups
UE 5.0UE 5.1UE 5.2UE 5.3UE 5.4UE 5.5UE 5.6UE 5.7#collectible#coin#pickup#score#sound#beginner

Blueprint JSON

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

{
  "nodes": [
    {
      "id": "n_tick",
      "position": {
        "x": 0,
        "y": 0
      },
      "node_type": "EventTick"
    },
    {
      "id": "n_getspeed",
      "position": {
        "x": 100,
        "y": 100
      },
      "node_type": "GetVariable",
      "variable_name": "RotationSpeed"
    },
    {
      "id": "n_multiply",
      "position": {
        "x": 250,
        "y": 50
      },
      "node_type": "Multiply_FloatFloat"
    },
    {
      "id": "n_makerot",
      "position": {
        "x": 450,
        "y": 50
      },
      "node_type": "MakeRotator"
    },
    {
      "id": "n_addrot",
      "position": {
        "x": 650,
        "y": 0
      },
      "node_type": "AddActorWorldRotation"
    },
    {
      "id": "n_overlap",
      "position": {
        "x": 0,
        "y": 300
      },
      "node_type": "OnComponentBeginOverlap",
      "component_name": "SphereCollision"
    },
    {
      "id": "n_sound",
      "position": {
        "x": 300,
        "y": 300
      },
      "node_type": "PlaySoundAtLocation"
    },
    {
      "id": "n_getloc",
      "position": {
        "x": 100,
        "y": 450
      },
      "node_type": "GetActorLocation"
    },
    {
      "id": "n_destroy",
      "position": {
        "x": 500,
        "y": 300
      },
      "node_type": "DestroyActor"
    }
  ],
  "variables": [
    {
      "name": "RotationSpeed",
      "type": "float",
      "default_value": "90.0"
    },
    {
      "name": "ScoreValue",
      "type": "int",
      "default_value": "10"
    }
  ],
  "components": [
    {
      "name": "SphereCollision",
      "type": "SphereComponent",
      "is_root": true,
      "properties": {
        "SphereRadius": 50,
        "CollisionProfileName": "OverlapOnlyPawn",
        "GenerateOverlapEvents": true
      }
    },
    {
      "name": "CoinMesh",
      "type": "StaticMeshComponent",
      "parent": "SphereCollision"
    },
    {
      "name": "PickupSound",
      "type": "AudioComponent",
      "parent": "SphereCollision",
      "properties": {
        "bAutoActivate": false
      }
    }
  ],
  "connections": [
    {
      "to_pin": "execute",
      "to_node": "n_addrot",
      "from_pin": "then",
      "from_node": "n_tick"
    },
    {
      "to_pin": "A",
      "to_node": "n_multiply",
      "from_pin": "Delta Seconds",
      "from_node": "n_tick"
    },
    {
      "to_pin": "B",
      "to_node": "n_multiply",
      "from_pin": "RotationSpeed",
      "from_node": "n_getspeed"
    },
    {
      "to_pin": "Yaw",
      "to_node": "n_makerot",
      "from_pin": "ReturnValue",
      "from_node": "n_multiply"
    },
    {
      "to_pin": "DeltaRotation",
      "to_node": "n_addrot",
      "from_pin": "ReturnValue",
      "from_node": "n_makerot"
    },
    {
      "to_pin": "execute",
      "to_node": "n_sound",
      "from_pin": "then",
      "from_node": "n_overlap"
    },
    {
      "to_pin": "Location",
      "to_node": "n_sound",
      "from_pin": "ReturnValue",
      "from_node": "n_getloc"
    },
    {
      "to_pin": "execute",
      "to_node": "n_destroy",
      "from_pin": "then",
      "from_node": "n_sound"
    }
  ],
  "parent_class": "Actor",
  "blueprint_name": "BP_Collectible"
}