so, I’m trying to make a keypad that works with Line Trace By Channel, to make the game more “immersive”, because I don’t want to use 2D widgets or some sort of “press ‘X’ key to write password”. My goal is to make the player come closer to the keypad and just click the buttons to try to get the correct password. I almost did it, but I’m stuck at the final blueprint settings.
I’ve used this Keypad BP for the settings. This Keypad BP works with the “OnClick” Event, so each collision box have it’s number value. I tried to change the OnClick Event to OnComponentHit, but it didn’t work, perhaps because of the Interaction Interface.
The only thing that really works is when I add an Event Interact (from the Interaction Interface, to connect the First Person BP with the Keypad BP) and connect it with the “Write Number” function, but it only writes the SAME number to every collision. Every collision is detected perfectly, by the way, but I can’t figure out how to separate each collision to write it’s number.
Here’s my setup:
First Person BP with the Line Trace By Channel → Break Hit Result → Interact Interface
You could hardcode tags into those comps and pass a tag converted to text right into the interface. You could pull a tag from the component pin mentioned in the previous post. Or you can pass the entire comp, depends on what else needs to happen.
Thanks a lot ClockworkOcean and @Everynone, I’ve done some different things, but with the same ideas as yours. I created the component tags on the Box Collisions and created a target into the First Person BP. When I Print Text/Print String, it detects every collision box and its component tags (1 to 9) perfectly.
After that, I tried to create a Text Output/String Output on the Interaction Interface, to convert the tag from the First Person BP to an Integer from the Keypad BP. This integer is from the function, it determinates the pressed number., but it didn’t work.