Skip to content

NicholasGrigoriev/ActorPoolPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Actor Pool Plugin

Zero-allocation actor pooling for Unreal Engine 5 via a World Subsystem.

Pre-spawn actors at level start, recycle them at runtime. No per-frame memory allocation, no GC spikes.

Installation

  1. Clone or download this repo into your project's Plugins/ folder:
    cd YourProject/Plugins
    git clone https://github.com/NicholasGrigoriev/ActorPoolPlugin.git
    
  2. Regenerate project files and build.

Quick Start

  1. Create a Blueprint subclass of ActorsPoolWorldSubSystem (the C++ class is Abstract).
  2. In the Blueprint's Class Defaults, assign a Pool Config data asset (ActorsPoolWorldConfig) that maps actor classes to pool sizes.
  3. Register the Blueprint in Project Settings → Asset Manager → Primary Asset Types to Scan:
    • PrimaryAssetType: UActorsPoolWorldSubSystem
    • AssetBaseClass: your Blueprint class
    • bHasBlueprintClasses: True
    • SpecificAssets: path to your Blueprint
  4. Use the pool in code or Blueprint:
    • SpawnActorFromPool — get an actor from the pool
    • ReturnActorToPool — return it when done
    • Optionally implement IObjectPoolInterface on your actor for spawn/despawn callbacks

How It Works

  • On level start, the subsystem reads the config and pre-spawns all actors (hidden, collision off, tick off)
  • SpawnActorFromPool pops an actor from the inactive list, teleports it, and activates it
  • ReturnActorToPool hides it and puts it back
  • If the pool is empty, optionally falls back to regular spawning

License

MIT

About

Unreal Engine 5 Actor Pool System — zero-allocation object pooling via World Subsystem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors