My cast wont work?

Keeps coming up with a cast failed and im not sure what object i should be linking this to
I have a blueprint for Keys and the Door
trying to cast to the Keys in the Door blueprint but cast keeps failing

You will need a reference to the key to use any type of “Cast to”. I would suggest to not use the object itself. Once you collected it you shouldn’t have a need for the key as actor anymore.

The inventory example from epic uses structs to save this stuff and that works just great.

What could also work just fine is adding an interface to the door and a “door” variable to your key which is editable. Once you placed it you then can place your door, then the key and once you selected the key you can just select the door it should interact with. Once you select it you can already unlock the door. If you want this “open this door” just add another boolean if it was opened already and if it’s open but not opened play some animation or display some text or whatever.