Using line trace to get a specific instance of an actor and running into issues

Hi, I am new to unreal and I am currently trying to use line trace so that when I press e on my actor, crop placement, it brings up a menu that lets you choose from seeds. Then using line trace I want to have it spawn the seed only at that specific actor. Because what happens right now if there is multiple instances of the actor, is the menu won’t appear for the first placed crop placement and the last placed crop placement lets the menu appear, but it spawns the seed at the first crop placement.

Line trace BP

Crop placement BP

Blueprints for the menu and spawning the seed

I would really appreciate any help as I have been stuck on this for a bit now.

The main problem is this

GetActorOfClass will just return the last instance put in the level. If you’re using a line trace, you can say to that actor ‘do something’ ( like replace with a blueprint, or grow leaves etc ).

How would I set that up or do you have a video that shows how to set that up?

Can you show me how to do that or have any good resources I can visit because all the videos I keep finding are using the interface with line trace and not line trace for multiple instances of an actor.

Make an interface

Make a door, that implements that interface

In my player

and you get

Door

It will work with any number of doors :slight_smile:

If you not sure about some of it, you can get more detail somewhere like