onclickunreal-engine4game-developmentunreal-blueprintunreal-development-kit

Can I click on 2 different pawns and have them print different things while having the same interact event?


So I have created a system where as the player, I can left click which will call a function called Interact which is located in my player event graph.Interact Event

The Interact events works just fine, it prints out the name of any pawn when I left click on them. But I would like to have specific interactions when I click on different pawns. If I have 2 different pawns, I would like to click on them and have it print different messages.

I tried going into the pawn/characters event graph and make an on-click event or hit result but I haven't found any luck or any tutorials on youtube. Preferably I would like the events to be located in the npc's I want to click on, not my own character.


If you didn't understand what I'm trying to ask, think of it like this, I want it to be like if I clicked on a snail, it will say "I'm a snail!". If I clicked on a horse he will say "I'm a horse!". But I want to keep the same interaction event for both characters.

Basically in the NPC event graph I want a (if I'm clicked on, do x event).

Any help?


Solution

  • Well, it turned out in my capsule component, the collision preset was not on OverlapOnlyPawn. So I was not able to click on him.