Search code examples
unreal-engine4unreal-blueprint

(UE4) Why won't this Custom Event execute?


So I want when the player presses the left key, the door/gate opens. There are doors constantly spawning in the level, but you can only open the one LEAST recently spawned, so I have the doors in an array. So when you press left, it gets the door at index 0 and opens only THAT door. Idk if that makes sense...

Here you can see what I'm doing: The Error in my Blueprint

I've been trying to figure out what this stupid error is literally all day. Why can't I figure something out that looks so simple!


Solution

  • According to your image, you should wire Pressed to the Cast to node, and wire cast successful to the Open node...

    Also make sure your PlayerBP_Normal is able to receive player input so that input action can be triggered.

    And to get [0] of the array to get the oldest door makes sense I think. Just to make sure you add spawned doors to the end of the array, so the first one is the oldest.