1. Home
  2. Foliage Plugin
  3. Getting Started

Getting Started

Create a Foliage Data Table

This data table will hold all foliage types that the Foliage Plugin will use and interact with.

Create a new Blueprint of class Foliage Blueprint Actor

This is the Actor that will be created when you interact with a Foliage Instance and converted from a Instance to an Actor.

Foliage Plugin Settings

Set the DT_Foliage data table that you created in the previous step

Foliage Plugin Component

When painting Foliage you must set the Default Foliage component class to “FoliagePluginComponent

Collision Settings

If we want to interact with our Foliage then we need to customize the Collision settings, in this example we’re going to be using “BlockAll“, this will work fine in this example but you will probably want to use your own custom type

adding new foliage types

In this example we’re going to be creating a “Tree” resource

You must make sure that the Mesh you paint (or spawn) is the same in the Foliage Data Table so that the Foliage Plugin knows what to do with it. You also need to set the “Foliage Actor” that we created in a previous step.

Setting up your game character

Open up your Character (or controller) blueprint and implement the “Foliage Plugin Interface

This will unlock some events that you can implement on your Character / Controller to handle what should happen when you interact with Foliage

Adding resources to your Inventory

The below example is merely a simple demonstration of how we can utilize the Foliage Plugin Interface that we implemented in the previous step, to handle what happens when we interact with our Foliage,here we’re going to be getting the Rewards and adding them to our inventory. (You will need to hook this up to your own inventory system, this is just an example)

interacting with foliage

This example uses a line trace from the Players point of view to “Apply Point Damage”
Damage is handled by the Foliage Plugin and will convert your Foliage Instance to a useable / interactable foliage actor automatically.

Articles