Iván

Unreal Engine

開發程式設計v1.0.0
作者:Iván更新於 2026-05-11unreal-engine@clawhub_ivangdavila/unreal-engine
程式碼生成Bug 修復

據 AlphaMoat 統計,截至 2026-09,Unreal Engine 累計下載 2,516 次、獲 5 個星標,在全部 5,078 個 AI 技能中排名第 4,089 位,在「開發程式設計」分類(577 個)中排名第 506 位。

累計安裝
169
累計下載
2516
星標
5
全站排名
#4,089
全站前 81% · 「開發程式設計」前 88%
平台累計安裝累計下載星標評論
ClawHub ↗6624014-
SkillHub ↗16925165—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

涵蓋 UObject 垃圾回收、UPROPERTY/UFUNCTION 宏、Actor 生命週期、Tick 效能、網路複製、資源引用和指標所有權等注意事項。該內容是通用參考,可能與具體引擎版本、專案架構或網路模型不符;應用前應對照專案文件和程式碼規範核驗。 發布前由 Unreal Engine 開發者審閱改動,並核驗編輯器與封裝版本中的行為。

資料釋出於 2026-10-27

可以用來做什麼

  • 排查 UObject 生命週期與引用問題
  • 核對 Blueprint 可存取性或複製邏輯
  • 檢查 Actor 生命週期、Tick 和資源引用

什麼時候用

  • 需要 Unreal Engine 程式設計問題的簡明參考時
  • 將建議應用到具體專案之前,先核實引擎版本、網路模型和本機編碼規範

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

檢查這段 Unreal Engine 程式碼的物件生命週期和複製邏輯,並把通用建議與需要按專案驗證的部分分開。

月度資料趨勢

累計下載2516
982180626302026-03 · 累計下載 10962026-05 · 累計下載 15082026-06 · 累計下載 16742026-07 · 累計下載 20292026-08 · 累計下載 22392026-09 · 累計下載 251626-0326-09
星標5
4552026-03 · 星標 42026-05 · 星標 42026-06 · 星標 52026-07 · 星標 52026-08 · 星標 52026-09 · 星標 526-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092516—5
2026-082239+10.3%5
2026-072029+21.2%5
2026-061674+11.0%5
2026-051508—4
2026-031096—4

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

3.0 KB · ClawHub v1.0.0
---
name: Unreal Engine
description: Avoid common Unreal mistakes — garbage collection, UPROPERTY macros, replication authority, and asset reference pitfalls.
metadata: {"clawdbot":{"emoji":"🎯","os":["linux","darwin","win32"]}}
---

## Garbage Collection
- Raw pointers to UObjects get garbage collected — use `UPROPERTY()` to prevent
- `UPROPERTY()` marks for GC tracking — without it, pointer becomes dangling
- `TWeakObjectPtr` for optional references — doesn't prevent collection, check `IsValid()`
展開全部(共 57 行)
- `NewObject<T>()` for UObjects — never raw `new`, GC won't track it

## UPROPERTY and UFUNCTION
- `UPROPERTY()` required for Blueprint access — and for GC tracking
- `UFUNCTION()` for Blueprint callable/events — also required for replication
- `EditAnywhere` vs `VisibleAnywhere` — edit allows changes, visible is read-only
- `BlueprintReadWrite` vs `BlueprintReadOnly` — controls Blueprint access level

## Actor Lifecycle
- `BeginPlay` after all components initialized — safe to access components
- Constructor runs on CDO (Class Default Object) — don't spawn actors or access world
- `PostInitializeComponents` before BeginPlay — for component setup
- `EndPlay` for cleanup — called on destroy and level transition

## Tick Performance
- Disable tick when not needed — `PrimaryActorTick.bCanEverTick = false`
- Use timers instead of tick + counter — `GetWorldTimerManager().SetTimer()`
- Tick groups for ordering — `PrePhysics`, `DuringPhysics`, `PostPhysics`
- Blueprint tick expensive — move hot logic to C++

## Replication
- Server is authority — clients request, server validates and replicates
- `UPROPERTY(Replicated)` for variable sync — implement `GetLifetimeReplicatedProps`
- `UFUNCTION(Server)` for client-to-server RPC — must be `Reliable` or `Unreliable`
- `HasAuthority()` to check if server — before executing authoritative logic
- `Role` and `RemoteRole` for network role checks — `ROLE_Authority` is server

## Asset References
- Hard references load with parent — bloats memory, use for always-needed
- Soft references (`TSoftObjectPtr`) load on demand — for optional or large assets
- `LoadSynchronous()` or `AsyncLoad` for soft refs — don't access until loaded
- Blueprint class references: `TSubclassOf<T>` — type-safe class selection

## Memory and Pointers
- `TSharedPtr` for non-UObjects — reference counted, auto-deletes
- `TUniquePtr` for exclusive ownership — can't copy, moves only
- `MakeShared<T>()` for creation — single allocation for object and control block
- Never mix raw `new/delete` with smart pointers — choose one pattern

## Common Mistakes
- Accessing null actor in Blueprint — use `IsValid()` node before access
- PIE (Play In Editor) vs packaged build differ — test shipping build
- Hot reload corrupts Blueprints — close editor, build, reopen
- `GetWorld()` null in constructor — world doesn't exist yet, use BeginPlay
- Spawning in constructor crashes — defer to BeginPlay or later
- `FString` for display, `FName` for identifiers — FName is hashed, faster comparison

「開發程式設計」分類下的熱門技能

Iván 的其他技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。