Unreal Engine
Installation
SKILL.md
Garbage Collection
- Raw pointers to UObjects get garbage collected — use
UPROPERTY()to prevent UPROPERTY()marks for GC tracking — without it, pointer becomes danglingTWeakObjectPtrfor optional references — doesn't prevent collection, checkIsValid()NewObject<T>()for UObjects — never rawnew, GC won't track it
UPROPERTY and UFUNCTION
UPROPERTY()required for Blueprint access — and for GC trackingUFUNCTION()for Blueprint callable/events — also required for replicationEditAnywherevsVisibleAnywhere— edit allows changes, visible is read-onlyBlueprintReadWritevsBlueprintReadOnly— controls Blueprint access level
Actor Lifecycle
BeginPlayafter all components initialized — safe to access components- Constructor runs on CDO (Class Default Object) — don't spawn actors or access world
PostInitializeComponentsbefore BeginPlay — for component setupEndPlayfor cleanup — called on destroy and level transition