I’ve got a good locked door working but I want to make it to where it is click to open when you look at the doorknob and you are standing in the door’s hitbox. Right now it’s just f to open. Here is a link to the door blueprint.
Hey @551810, as I can see, you are not yet so experienced with the engine so I hope I can somehow help you without going into too much depth, so not using any Interfaces with Interact Logic, but more simpler code.
As you can see, I’ve made a little Interactable Logic within the Player Character Blueprint. Each tick, we are going to send out a LineTrace 500 units ahead of where the Camera currently is. If the Trace hit’s something, check if it had the “Door” Actor Tag and if the Hit Component was a “Knob” (by using Component Tags).
What I mean by that is the fact that you can add Tags to every Actor and their respective Components in their Details Panel, just search for “Tag”.
Now, I made a simple Door Blueprint with a “Door” Tag, existing of just the Door Static Mesh and the Door Knob Sphere Collision Component with the “Knob” Tag for the Linetrace.
The Sphere Collision Component has following Custom Collision rules:
It blocks the Visibility Channel only, the Channel on which we are currently tracing in.
Now look back into the first picture. We now set the “Interactable Door” Variable, which is just a simple Actor Object Reference Variable. Now if we press “E”, we check if there is currently one available door, if yes, open it when you have the keys. (you can get this validate check by getting the variable and rightclicking on it and choose the last Option “Convert to Validated Get”)
If I can further assist you, reach out to me!
Wow, thanks. This is exactly what I needed!
Glad to help you! Remember, this is a very unflexible way to Interact with Actors. In the future, you would add an Interact Interface and Check if the hit Actor implements it.
If I solved your Problem, please mark my response as the Solution, thank you!
Its weird, the solution box isnt showing up for me so i cant mark anything as a solution. Other than that, do you know of any good resources to learn more about blueprints?
I surely do. I can totally recommend Tutorials by Ryan Laley (https://youtube.com/c/RyanLaley), Reid (https://youtube.com/c/ReidsChannel) and Matt Aspland (https://youtube.com/c/MattAspland)
Just search for the things you are currently looking for an 99% they got it covered in some way. These three Channels helped me a lot, and I mean A LOT. There is 0 Need to purchase any course as soon You‘ve Followed a few Tutorials from them and get a good feeling about Blueprints. Good luck!
Edit:
To Follow up my Main Statement, learn the usage of Interfaces. They Are so amazing and Made for Communication between Blueprints without Casting (as it is way more expenive to cast). I guess Ryan Laley Made an Introduction about it, Not sure. But he surely Made an Interaction System!
Thank you very much!