This is an interface and is optional. It is used to handle possible events when being generated from the pool and recycled by the pool. If you do not have any logic that needs to be triggered, you can choose not to inherit the interface or implement the interface event.

In Blueprint you can add it in Class Settings → Interfaces


- OnSpawn:Returns the initialization event executed when the generated and registered object is generated. It is similar to BeginPlay. Because the BeginPlay event will not be executed when it is taken out of the object pool, an interface is provided here to handle your initialization logic.
- OnRelease:The event executed when the object is released into the object pool (because the object pool manager takes over this object, hides it, does not render it in the world, and prevents it from being created and destroyed frequently), so the default life cycle end events such as Destroy will not be executed at this time, so here is an interface to handle your destruction logic.