I am trying to have one of my actors spawn at the location of an arrow on a different actor but I can not seem to get it to work

I am new to unreal development and I am having issues with my game.

How I want to have it set up is to make it so when you click the button your actor spawns on the spawn location 1 I have set up.

When I play it, the object I want spawned in, patch 1, does not spawn into the right location.

I am really new to unreal and would love any help at all. Here are my

Here are my screenshots, Seedpicker is the menu actor, spawn location is an actor inside of an actor because I was just trying anything to get it to work.

Hey there, welcome to the community!

Before spawning Patch1, you need to set the value of the SpawnPoint1 variable in SeedPicker to the position of the SpawnPoint1 Component in your CropPlacement actor.

To do that, you need to get a reference to your CropPlacement actor, then pull the GetActorTransform node from it.

Something similar to this:

How you get that reference depends on your setup. Maybe something like GetAllActorsOfClass or a line trace, etc.

I hope this helps! Feel free to ask more if you need to.

Thank you so much, but I’m a little confused on how references work, especially with cast to systems, I came from unity so I am used to arrays with gameobjects, in this situation where the player character isn’t involved, how would I set up a reference?

Hey I just found a great video and it works, but I wanted to know how would I get it to work if I had multiple instances of crop placement. As in for each one to have it spawn the actor on each individual corresponding crop placement.

That depends on how your player is meant to select the crop placement. If it’s the one in front of the player character, for example, you might do a Line Trace from the player actor towards its forward Vector, checking if it overlaps with a Crop Placement actor, and then storing that in a variable like “Current Crop Placement”. If it’s a mouse cursor based game you can use the “Get Hit Result Under Cursor by Channel” for the same purpose.

If the player is meant to be able to select multiple Crop Placement actors, you can create an Array of Crop Placement variable in the blueprint to store all the selected ones, and then use a For Each loop to act on all of them in one go.
You can change a variable to an Array by clicking the icon to the right of the Variable Type selector.

And here’s a quick example of how For Each can be used:

It works! Thank you so much my g.o.a.t you have fixed a major roadblock!