Crops - Rows of vegetable static meshes

Hello Community,

Somewhat a beginner to UE4. I am needing to create a pretty big farming landscape that has crops of different varieties. Each vegetable crop should be a couple dozen rows. Also, each crop will be facing a different direction, so using the landscape grid will not work.

I have all the static mesh varieties I need, just need a good efficient and flexible way to lay them out in rows.

Any help would be greatly appreciated!

  • Jeremy

Best way i know is to create an blueprint, in wich you use loops to set up your crop rows and lenght.
First you set up your start position. Spawn the first crop. ill call this 0/0
Maybe an variable for rows and row lenght
After that you first add the first row, and over a loop fill it. 0/1 0/2 0/3 and so on.
After that you set your loop location start to the 2d row and fill it the same way.

i agree this is a decent option but your explanation is a little is a little unclear so below is an example of how this can be done. in the example i was placing tiles for a turnbased strategy game. also i have the event set so i could run it in the editor as you can see in the details panel, which allows me to create the actors in the level editor as if i placed them myself. i was also recreating the levels for testing so thats why there is the first section that gets the existing tiles and destroys them.

anyways the part your concerned with comes after the for each. here you have two arrays one which serves as the columns and the other the rows or vice versa depending on how you connect to the spawn. the grid size variable is how many actors you want in each row/column, so if you want 10 rows of 10 carrots you would set the grid size to 10, you can separate each axis as well to create rectangles. the multiply nodes are the space between each actor, so if you want ech plant to be 100uu apart set it as shown, again you can change the values if you want more space between rows than between each plant in the column. the last step is to just spawn the actor.

another few things to note here; the ways its shown doesnt have a z value set so youll need to do that. the location is based on the world origin, if you want it based on the actor location then you will need to add all the values to the actors location. last this is currently setup to work with flat ground, though if you wanted it to work for any unlevel ground you could easily setup a line trace from a higher point nd base the z location on the hit result.

1 Like