Object Pooling
  • Pool Pool Pool
  • Components
    • Pool Manager
    • Pool Asset
    • Project Configuration
  • Interface
  • Global Functions
Powered by GitBook
On this page

Interface

PreviousProject ConfigurationNextGlobal Functions

Last updated 10 months ago

The Pool Interface in Blueprints provides a way to manage the lifecycle of pooled objects by defining functions that can be implemented to handle the enabling and disabling of objects. This interface ensures that objects are properly prepared when they are retrieved from or returned to the pool.

Using the Pool Interface in Blueprints

When working with the Pool Interface in Blueprints, you typically focus on implementing the interface functions and ensuring that these functions are called appropriately during the object's lifecycle. Here's how to access and use the Pool Interface in Blueprints.

Implementing the Pool Interface

  1. Add the Interface to Your Blueprint:

    • Open the Blueprint you want to make poolable (e.g., a character or an actor).

    • Go to the Class Settings.

    • In the Interfaces section, click Add and choose the PoolInterface from the list.

  2. Implement the Interface Functions:

    • After adding the interface, the functions EnableObject and DisableObject will be available as events in the Event Graph.

    • Implement these events to define what happens when the object is enabled (retrieved from the pool) and disabled (returned to the pool).