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.
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.
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.