Knowledge base
Knowledge base
Knowledge base
Free, anonymous browsing of Unreal Engine Blueprint examples, node references, and best practices. The same content the WoalzCraft plugin uses to generate Blueprints.
35 results for object
Blueprint-exposed version of NewObject. Cast result to your specific class.
ConstructObjectFromClassUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoFor non-Actor objects (UObjects). Actors must use SpawnActorFromClass instead. Outer is usually 'self' or GetTransientPackage().
NewObjectUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoWhy: Your code reads from a '{ref}' reference, but nothing was assigned to it. UE5 doesn't error at compile time, but warns that the runtime access will crash with null-pointer. Fix: Wherever this BP spawns, set the reference via Spawn Actor From Class → Set Reference. If it should be set from outside, expose the variable (eye-icon = Instance Editable) so it's set in the level editor. Add an Is Valid? Branch before each read to gracefully handle null.
Variables in pool manager (GameMode or Subsystem): Pool (Array<Actor>), PoolClass (TSubclassOf<Actor>). Init: Loop N times → SpawnActorFromClass → SetActorHiddenInGame(true) → SetActorEnableCollision(false) → SetActorTickEnabled(false) → Array Add to Pool. GetFromPool: ForEachLoop(Pool) → GetActorHiddenInGame → Branch(true) → SetActorHiddenInGame(false) → SetActorEnableCollision(true) → SetActorTickEnabled(true) → SetActorLocationAndRotation → Return actor. If none available: SpawnActorFromClass. ReturnToPool: SetActorHiddenInGame(true) → SetActorEnableCollision(false) → SetActorTickEnabled(false) → SetActorLocation(far away or (0,0,-9999)).
Returns null if asset not loaded. Use AsyncLoadAsset first, then resolve.
Conv_SoftObjectRefToObjectUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agostring
A pointer to a UObject instance. If the target is destroyed the reference becomes invalid — always IsValid-check before use.
A SceneComponent with simulate-physics enabled. Driven by forces, gravity, collisions instead of explicit transforms.
A live, runtime object of a class. Properties on an instance can differ from defaults set in the class.
Pattern: PoolManager with Array<AActor*> AvailablePool. Init: loop SpawnActor N times → SetActorHiddenInGame(true) → SetActorEnableCollision(false) → Array_Add to pool. GetFromPool: Array_Length > 0 → remove last → SetHidden(false) → SetCollision(true) → SetActorLocation → return. ReturnToPool: SetHidden(true) → SetCollision(false) → Array_Add back.