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
累计下载
2,516
星标
5
全站排名
#4,089
全站前 81% · 「开发编程」前 88%
平台累计安装累计下载星标评论
ClawHub ↗662,4014-
SkillHub ↗1692,5165—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

涵盖 UObject 垃圾回收、UPROPERTY/UFUNCTION 宏、Actor 生命周期、Tick 性能、网络复制、资源引用和指针所有权等注意事项。该内容是通用参考,可能与具体引擎版本、项目架构或网络模型不符;应用前应对照项目文档和代码规范核验。 发布前由Unreal Engine开发者审阅改动,并核验编辑器与打包版本中的行为。

资料发布于 2026-10-27

可以用来做什么

  • 排查 UObject 生命周期与引用问题
  • 核对 Blueprint 可访问性或复制逻辑
  • 检查 Actor 生命周期、Tick 和资源引用

什么时候用

  • 需要 Unreal Engine 编程问题的简明参考时
  • 将建议应用到具体项目之前,先核实引擎版本、网络模型和本地编码规范

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

检查这段 Unreal Engine 代码的对象生命周期和复制逻辑,并把通用建议与需要按项目验证的部分分开。

月度数据趋势

累计下载2,516
9821,8062,6302026-03 · 累计下载 1,0962026-05 · 累计下载 1,5082026-06 · 累计下载 1,6742026-07 · 累计下载 2,0292026-08 · 累计下载 2,2392026-09 · 累计下载 2,51626-0326-09
星标5
4552026-03 · 星标 42026-05 · 星标 42026-06 · 星标 52026-07 · 星标 52026-08 · 星标 52026-09 · 星标 526-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,516—5
2026-082,239+10.3%5
2026-072,029+21.2%5
2026-061,674+11.0%5
2026-051,508—4
2026-031,096—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),按月更新。口径说明见数据方法。