Create the Data Table (Foliage Data)
Create a Blueprint Class of type FoliagePluginActor
Assign the Data Table and the Foliage Actor in the Project Settings
(FOLIAGE ACTOR HAS BEEN MOVED TO THE DATATABLE)
Change the Component Class for your Foliage to use the “FoliagePluginComponent“
Create a new Tree resource in the Foliage Data Table you previously created, see example below
Set the BP_FoliageActor class that you created earlier in the DataTable
Create a new Rock resource in the Foliage Data Table you previously created, see example below
In the BP_SurvivalCharacter Blueprint, add the Foliage Plugin Interface
Example of adding the harvested resources to our inventory
Example of how to enable Melee Weapons to harvest Trees and Rocks
OPEN THE “BP_MASTERMELEEWEAPON” BLUEPRINT (/BLUEPRINTS/HOLDABLES/BP_MASTERMELEEWEAPON) AND MODIFY THE “GIVE DAMAGE ONCE” FUNCTION TO THE EXAMPLE BELOW
Example of how to enable harvesting with “E” Interact Key
Open the “BP_PlayerInventoryComponent” (/Blueprints/Components) and modify the “Is inventory actor?” macro