In my project, I have several drawers and cabinets that are constructed with blueprints, and each of them has varying loot spawning in them. Since the interactable objects are so densly positioned, I can’t really use trigger volumes to open said cabinets and drawers, so I’ll have to most likely rely on line traces to do the trick.
Now, my problem with this is that I can’t figure out how to communicate the line trace hit across to the cabinet blueprint. I basically need to know which drawer(component, in another blueprint) the line trace actually hit.
My initial plan was to have the line trace originate from the Character blueprint (which it currently does), and have it interact with other blueprints placed around the scene.
Jacky & Gabriel, thanks, both of you were super helpful.
But I still have an ongoing problem. What I specifically need to achieve here, is to figure out which component was hit with the line trace from my player. Currently it only registers the hit as the blueprint as a whole, and I can’t seem to figure out which static mesh component it was in the blueprint.
Hmm…right now all i can think of is to make a sphere overlap components at the hitpoint of the trace and get the drawer component it overlaps. I’ll let you know if i can think of a less hacky way.
If you’re looking for just the Components that are hit by the line trace, you can use Hit Component instead of Hit Actor from the Break Hit Result node.