Skip to main content
Reference

Blueprint Functions

Besides damage and the Foliage Actor events, the plugin has functions you can call from any Blueprint. They are in the Foliage Plugin category.

Functions marked Server only do nothing when called on a client. Call them from a Server RPC, see Multiplayer Harvesting.

Foliage Plugin Library​

Available everywhere, no target needed.

FunctionReturnsDescription
Interact With FoliageBooleanHarvests the foliage instance, Foliage Actor or destructible mesh actor in Hit without damage. Returns true if something was harvested. Server only. See Interaction and Pickups.
Is Harvestable FoliageBooleanTrue if Hit is a foliage instance whose mesh is in the Data Table, or a Foliage Actor with uses left. Works on clients.
Get Foliage Data From HitBoolean, Out DataGets the Data Table row of the foliage instance or Foliage Actor in Hit. Returns false if the hit is not foliage.
Get Foliage Actor From HitFoliage ActorThe Foliage Actor in Hit, also when the hit is the actor of its destructible mesh. None if the hit is not a Foliage Actor.
Get Foliage ManagerFoliage ManagerThe Foliage Manager of the world. None until the first foliage component has started.

Foliage Plugin Component​

Call these on the FoliagePluginComponent that holds the instance, for example Hit Component from a hit result cast to FoliagePluginComponent. The instance index is Hit Item.

FunctionDescription
Interact With InstanceHarvests the instance without damage. The same as Interact With Foliage for an instance. Server only.
Remove Foliage InstanceHides the instance without rewards. With Permanently on, it is removed for good, otherwise it respawns like a harvested instance. Returns false if the instance is already hidden. Server only.
Foliage Get DataThe component's Data Table row.

Foliage Manager​

Get the manager with Get Foliage Manager.

FunctionDescription
Restore All Foliage InstancesBrings back every hidden and removed instance, spread over several frames. Ignores Respawn Delay and the blocking checks. Foliage Actors that still exist are removed first, or returned to the pool. Server only.
Get Num Harvested InstancesThe number of hidden and removed instances. On a client, this is what has been replicated so far.
Save Foliage Data to DiskSaves right away. See Saving and Loading.
Is Foliage Data DirtyTrue if something changed since the last save.
Is Saving Foliage DataTrue while a background save is being written.

For example, to reset the world, call this on the server:

Restore All Foliage Instances with Get Foliage Manager

Functions you can override in your own manager are listed in Custom Foliage Manager.