Skip to main content

Foliage Actor

The FoliagePluginActor is the Actor that replaces a foliage instance. Create a Blueprint subclass of it and set it as Foliage Actor Class in the Data Table.

Its events and functions are listed under Override in the My Blueprint panel:

Overridable events and functions

Components​

ComponentDescription
RootScene root.
Foliage MeshStatic mesh component. The plugin sets it to the instance's mesh.

Add a Geometry Collection Component (UE5) or Destructible Component (UE4) yourself if you use destructible meshes.

Events​

EventRuns onCalled when
BPE On Foliage DamagedServerThe actor was harvested. Receives the damage, instigator, causer, damage type and rewards.
BPE On Foliage Remaining Uses UpdatedServer and clientsThe remaining uses changed.
BPE On Foliage Mesh UpdatedServer and clientsThe mesh was set, right after the actor was spawned.
BPE On Foliage DepletedServer and clientsThe remaining uses reached 0. Called once.

The same events are also available as the bindable delegates On Foliage Remaining Uses Updated, On Foliage Mesh Updated and On Foliage Depleted, for example to listen from a widget.

Overridable functions​

FunctionDefault behaviorOverride to
Handle Foliage DamageChecks the damage type, gives the reward, reduces the remaining uses and breaks the destructible mesh.Change when a hit counts, for example with health. Call the parent to keep the default behavior.
Handle Foliage RewardCalls On Foliage Harvested on the Instigator and the Damage Causer. Returns false if neither implements the interface.Give rewards in your own way. If you override it, call On Foliage Harvested yourself if you still want the interface to be used.
Handle Destructible DamageBreaks the destructible mesh at the hit location. Runs on server and clients.Break the mesh in your own way.
Handle Foliage Impulse on DepletionPushes the mesh near its top in a random direction, scaled by its mass and Physics Impulse Multiplier.Make it fall in a specific direction, for example away from the player.

Handle Foliage Damage and Handle Foliage Reward only run on the server.

Functions​

FunctionDescription
Foliage Get DataReturns the actor's row from the Data Table.
Foliage Get Remaining UsesReturns the remaining uses.
Foliage Get RewardReturns Rewards on Harvest from the row.
Reduce Remaining UsesReduces the remaining uses. Server only.
Add Remaining UsesAdds remaining uses. Server only.
Set Remaining UsesSets the remaining uses. Server only.

Reduce, Add and Set Remaining Uses can be called from inside your Foliage Actor Blueprint.