Can't figure out what's wrong with my key

Hey all, I’m using this forum for the first time so sorry for any wrong formatting or anything.

I’m making a top-down in UE5.1 using PaperZD for class. It’ll be a puzzle game, so I’m trying to figure out how to make a door locked unless you have a key to open it (interacting with the brick gives you the key, which will allow you to open the door ((right now its minecraft steve)

I keep getting this error message after running the game, and I can’t figure out where I went wrong in my code. To me, this looks like it would run fine? It should, anyway, it makes sense. I’d appreciate any help I can get, thank you. I’ve attatched pictures to the blueprints of my door, key, player, and the error code.




Again, thanks so much for the help. I would really appreciate any feedback as soon as possible, <3

Your player reference is not assigned ( valid ).

It’s not enough to have a reference of the correct type, the reference actually has to point at the correct object ( here, the player ).

It’s a little bit like me walking into a room with 10 people sitting in chairs and saying ‘You, get me a newspaper!’. But nobody stands up.

Why not?, because I wasn’t pointing at anybody.

So, try this

and the rest should work…

1 Like

Hey! Thanks so much for replying! I added this code to my level blueprint but unfortunately I’m still getting an error. Is there anything else I need to do? Anything I need to check up on?

I think you need to put that in every blueprint that uses the player variable :wink: