How do I fix this error?

Hi,
I am having trouble with a locked door that I am making and keep getting this error when ever I press “E” Blueprint Runtime Error: “Accessed None trying to read property K2Node_DynamicCast_AsBP_First_Person_Character”. Node: Branch Graph: EventGraph Function: Execute Ubergraph Starter Door BP Blueprint: StarterDoorBP

I don’t know how to fix this and I have been trying to fix this error for the past 30 minutes

image


image

I am following a tutorial for this locked door here is the YouTube Link: How To Open A Locked Door With A Key - Unreal Engine 4 Tutorial - YouTube

And I am using UE5

Thanks

1 Like

This is because of the event on the “C” button, you are trying to get access to the character through an event that does not give you any information about this character, you should separately cast a character in the event by pressing “C”, for example, on this event get all the actors overlapped by the door and find your character among them by the cast function, then get your “Has Card?” from it

2 Likes

Hey Fyr,
I am a little confused on what to do from your reply. If possible could you send me a picture on what I should do?

Thanks :slightly_smiling_face:

Here you are


Just replace the “mesh” on your door, and the character in the cast function with your character class

2 Likes

So I would attach it like this?

1 Like

Almost right, you need to take a “Has Card?” from the upper cast, then it will work, I hope.

1 Like

Ok thank you for helping me fix this :slight_smile:

1 Like