I am making a 3rd person interaction system that relies on collision component in the blueprint of the interactable object. When actor with tag “Player” is colliging with the collision component, interaction becomes available, and a key must be pressed to interact with that object. Should I implement the key press event in the character blueprint, or can I handle it directly within the object’s blueprint using the gate node as shown in the attached screenshot?
Also, I plan to have multiple interaction types, but the core logic will be similar across all. Is there a way to make this code reusable in different blueprints without duplicating it?
Approach 1 is better. Because you can make a ‘parent’ interactable object without having any code in the player, which is more modular.
Having said that, usually the enable input is on the blueprint, not the controller. Input is always enabled by default on the controller, because it’s how you’re moving the player.
Also, it a good idea to check it’s the player on end overlap. It could be anything.
You don’t have to use tags, you can just say
The main downside of the overlap approach, is that the player can interact with the object using their butt