Unity
v1.0.0Avoid common Unity mistakes — lifecycle ordering, GetComponent caching, physics timing, and Unity's fake null.
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The name/description promise Unity coding guidance and the SKILL.md is purely that: a checklist of Unity lifecycle, performance, physics, serialization, and coroutine tips. It requests no binaries, env vars, or config paths that would be unrelated to providing documentation-like guidance.
Instruction Scope
The runtime instructions are static prose with actionable advice for Unity developers. They do not instruct the agent to read files, call external endpoints, access environment variables, or perform system operations beyond presenting text—no scope creep detected.
Install Mechanism
There is no install spec and no code files. As an instruction-only skill, it writes nothing to disk and has a minimal footprint.
Credentials
The skill requires no environment variables, credentials, or config paths. The lack of requested secrets is proportional to its documentation-style purpose.
Persistence & Privilege
always is false and the skill does not ask for persistent permissions or modify other skills/config. Autonomous invocation is allowed by default but, given the skill's instruction-only nature and lack of requested privileges, this does not create a meaningful risk.
Assessment
This skill is essentially a static tipsheet for Unity development and doesn’t request any credentials, installs, or filesystem access—so it’s low-risk and coherent with its description. Before installing, consider: (1) the content has no provenance or links to authoritative sources—treat it as general guidance and verify critical recommendations against Unity docs, (2) if future versions add install steps, downloads, or env-var requirements, re-check those changes before accepting them, and (3) be cautious about following code suggestions verbatim in production projects without review or testing.Like a lobster shell, security has layers — review code before you run it.
Runtime requirements
🎮 Clawdis
OSLinux · macOS · Windows
latest
Lifecycle Order
AwakebeforeStart— use Awake for self-init, Start for cross-referencesOnEnablecalled beforeStart— but afterAwake- Order between scripts not guaranteed — use Script Execution Order if needed
Awakecalled even if disabled —Startonly when enabled
GetComponent Performance
GetComponentevery frame is slow — cache inAwakeorStartGetComponentInChildrensearches recursively — expensive on deep hierarchiesTryGetComponentreturns bool — avoids null check, slightly faster- Use
RequireComponentattribute — ensures dependency, documents requirement
Physics Timing
- Physics in
FixedUpdate, notUpdate— consistent regardless of framerate FixedUpdatecan run 0 or multiple times per frame — don't assume 1:1Rigidbody.MovePositionin FixedUpdate —transform.positionbypasses physicsTime.deltaTimein Update,Time.fixedDeltaTimein FixedUpdate — or just use deltaTime
Unity's Fake Null
- Destroyed objects aren't truly null —
== nullreturns true, but object exists - Null-conditional
?.doesn't work properly — use== nullorboolconversion Destroydoesn't happen immediately — object gone next frame- Use
DestroyImmediateonly in editor — causes issues in builds
Coroutines
StartCoroutineneeds MonoBehaviour active — disabled/destroyed stops coroutinesyield return nullwaits one frame —yield return new WaitForSeconds(1)for timeStopCoroutineneeds same method or Coroutine reference — string overload unreliable- Can't return values — use callbacks or set field in coroutine
Instantiate and Pooling
Instantiateis expensive — pool frequently created/destroyed objectsInstantiate(prefab, parent)sets parent — avoids extra SetParent callSetActive(false)before returning to pool — not Destroy- Pool inactive objects under a parent — keeps hierarchy clean
Serialization
[SerializeField]for private fields in inspector — prefer over publicpublicfields auto-serialize — but exposes API you may not want[HideInInspector]hides but still serializes —[NonSerialized]to skip entirely- Serialized fields keep inspector values — code defaults ignored after first serialize
ScriptableObjects
- Data containers that live as assets — share between scenes/prefabs
CreateAssetMenuattribute for easy creation — right-click → Create- Don't modify at runtime in builds — changes not saved (except in editor)
- Great for config, item databases — reduces prefab duplication
Common Mistakes
Findmethods every frame — cache references- String comparisons for tags — use
CompareTag("Enemy"), nottag == "Enemy" - Physics queries allocate — use
NonAllocvariants:RaycastNonAlloc - UI anchors wrong — stretches unexpectedly on different resolutions
async/awaitwithout context — use UniTask or careful error handling
Comments
Loading comments...
