Learn how to use Object Pooling entirely in Blueprints!
- Edit → Plugins → Search "ObjectPooling"
- Enable "ObjectPoolingSubsystem" ✓
- Restart editor
- Open Content Browser
- Create new Blueprint Actor
- Parent Class: Search "AObjectPoolingEntry"
- Can see it? → Plugin working! ✓
- Right-click → Blueprint Class
- Parent:
AObjectPoolingEntry - Name:
BP_MyPooledActor - Save and open
Add these events (right-click → Event → search):
Event On Initialize In Pool
├─ Set Custom Property to Default
├─ Set Location to 0,0,0
└─ [Reset all state]
Event On Spawn Actor
├─ (Optional) Print String "Spawned!"
└─ [Startup logic]
Event On Despawn Actor
├─ (Optional) Stop All Audio
└─ [Cleanup]
- Open
BP_GameMode(or your game mode) - Event BeginPlay
- Right-click → Spawn Actors Pool List By Class
Spawn Actors Pool List By Class
├─ Element Class: BP_MyPooledActor (Your actor)
├─ Spawn Amount: 50 (Initial)
├─ Max Spawn Amount: 200 (Maximum)
├─ Extend On Empty: True (Allow growth)
└─ Spawn Timer Rate: 0.02 (Spawn speed)
Chain multiple nodes:
Event BeginPlay
├─ Spawn Actors Pool List (Projectiles)
├─ Spawn Actors Pool List (Effects)
└─ Spawn Actors Pool List (Enemies)
Some Event (e.g., Input)
│
├─ Spawn Actor From Pool
│ ├─ Actor Class: BP_MyPooledActor
│ ├─ Spawn Transform: [Your location]
│ └─ Out Actor: [Get from output pin]
│
├─ Is Valid (Out Actor)
│ ├─ True: Use the actor
│ └─ False: Pool exhausted
Spawn Actor From Pool
├─ Actor Class: BP_Explosion
├─ Spawn Transform: Explosion Location
├─ Return After Lifetime: True ← Enable this
├─ Lifetime: 3.0 ← 3 seconds
└─ [Returns automatically after 3s]
Create Variable: CurrentActor (Actor)
Spawn Actor From Pool
├─ [Configure]
└─ Out Actor → Set CurrentActor
Later - Use:
├─ Cast CurrentActor to BP_MyActor
└─ [Call functions]
Setup (Game Mode BeginPlay):
Spawn Actors Pool List By Class
├─ Element Class: BP_Projectile
├─ Spawn Amount: 100
├─ Max Spawn Amount: 300
├─ Extend On Empty: True
└─ Spawn Timer Rate: 0.02
Fire Event:
Event Fire Weapon
│
├─ Spawn Actor From Pool
│ ├─ Element Class: BP_Projectile
│ ├─ Spawn Transform: [Weapon location]
│ └─ Out Actor: [Get result]
│
├─ Is Valid
│ └─ Cast to BP_Projectile
│ ├─ Launch
│ └─ Set Owner
Return (On Hit):
Event On Hit
│
├─ Apply Damage
│
└─ Despawn Actor (Self)
Setup:
Spawn Actors Pool List By Class
├─ Element Class: BP_Explosion
├─ Spawn Amount: 30
└─ Max Spawn Amount: 100
Play Effect:
Event Explosion at Location
│
└─ Spawn Actor From Pool
├─ Element Class: BP_Explosion
├─ Spawn Transform: Location
├─ Return After Lifetime: True
└─ Lifetime: 3.0
[Auto-returns, no cleanup needed!]
Setup:
Event BeginPlay
│
└─ Spawn Actors Pool List By Class
├─ Element Class: BP_Enemy
├─ Spawn Amount: 50
├─ Max Spawn Amount: 150
└─ Extend On Empty: True
Spawn Wave:
Event Start Wave
│
├─ For Loop (0 to 30)
│ │
│ ├─ Spawn Actor From Pool
│ │ ├─ Element Class: BP_Enemy
│ │ ├─ Spawn Transform: Random Location
│ │ └─ Out Actor: [Enemy]
│ │
│ └─ Is Valid (Enemy)
│ └─ Cast to BP_Enemy
│ ├─ Set Target: Player
│ └─ Add to Array
On Enemy Death:
Event On Enemy Death
│
├─ Remove from Spawned Array
│
├─ Is Array Empty
│ ├─ True: Start Next Wave
│ └─ False: Continue
Fix 1: Create pool first
✓ Call "Spawn Actors Pool List By Class" in Event BeginPlay FIRST
Fix 2: Increase pool size
Max Spawn Amount: 100 → 300
Extend On Empty: False → True
Fix 3: Check actor class
✓ Element Class must inherit from AObjectPoolingEntry
Fix:
In BP_MyPooledActor → Event On Spawn Actor
├─ Ensure visibility (already set by system)
└─ Check SetActorHiddenInGame(false)
Fix:
In Project Settings → ObjectPooling Subsystem
├─ SpawnPerBatch: 40 → 20 (slower but smoother)
└─ DestroyPerBatch: 40 → 20
Fix:
Max Spawn Amount needs realistic limit
Bad: 100 initial, 10000 max, expandable
Good: 100 initial, 300 max, expandable
✅ DO
- ✓ Create pools in Event BeginPlay
- ✓ Check if actor is valid before using
- ✓ Use auto-return for effects
- ✓ Use manual despawn for enemies
- ✓ Set reasonable max sizes
❌ DON'T
- ✗ Create pools during gameplay
- ✗ Forget null checks
- ✗ Set unlimited max sizes
- ✗ Spawn thousands at once
- ✗ Leave pools uncleaned
| Task | Node |
|---|---|
| Create pool | Spawn Actors Pool List By Class |
| Spawn actor | Spawn Actor From Pool |
| Check valid | Is Valid |
| Return to pool | Despawn Actor |
| Get placeholder | Get Object Pooling Placeholder |
SpawnActorsPoolListByClass
├─ Element Class: Your BP_Actor
├─ Spawn Amount: 50-200 (initial)
├─ Max Spawn Amount: 100-500 (limit)
├─ Extend On Empty: true/false (growth)
└─ Spawn Timer Rate: 0.01-0.05 (speed)
SpawnActorFromActorListByClass
├─ Actor Class: Your BP_Actor
├─ Spawn Transform: Location
├─ Out Actor: (receive result)
├─ New Owner: (optional)
├─ Return After Lifetime: true/false
└─ Lifetime: 5.0 (seconds)
Version: 1.0 | All Blueprint, No C++! 🎨