Can't find solution to interaction

Hey everyone, I’m struggling to find a solution to fire an interact event. Those are the details with reference to the images:

  • It all starts with InputAction Interact
  • string “true” is printed in image 1
  • image 1 is in the player character blueprint
  • image 2 is located in the parent of the NPC
  • image 3 shows the trigger of “ask for quest” in the top of image 1
  • String test in image 3 is not firing

I thought it had something to do with an object reference I need to put in the initial Interact event but no idea how to go about this. Any help will be very much appreciated!!

Two things about this image from the player BP

344129-screenshot-1.jpg

  1. The yellow pin let’s you know you’re calling the interact event on yourself.

  2. You do need to choose the correct interact event from the list ( right click ) and pass it an actor reference, of the thing you want to interact with.

I thought it had something to do with an object reference I need to put in the initial Interact event but no idea how to go about this. Any help will be very much appreciated!!

Like I say, when you right click and search for the interface event, there is more than one to choose from, you just chose the wrong one.

Cheers for the insights, it works now. Is this the best way to go about this (check image)? Is this the only way to refer to actors with a box collision?

344209-2.png

Hi - sorry, I’m not getting notifications.

It’s not the best way to interact, no. It’s no problem, unless you’ve got hundreds of NPCs all present at once. But I’m sure you’re noticing that, you’re kinda searching twice for the interaction ( once with the overlap, and once with the get overlapping actors ).

For me, the hands down winner is always line trace. When you click ‘interact’, your player can do a line trace to see if there’s an NPC in front of you. If there is, the interact event is sent to them, otherwise nothing happens.

This is about line traces:

This way, you don't need any code searching for actors, or overlap code, AND you can interact with ANY kind of actor.

No worries, I tried line tracing but got a bit stuck. I’ll make it work now

It’s easier than this method, I think :slight_smile:

Try the vid and see where you get to…