Install
openclaw skills install unityAvoid common Unity mistakes — lifecycle ordering, GetComponent caching, physics timing, and Unity's fake null.
openclaw skills install unityAwake before Start — use Awake for self-init, Start for cross-referencesOnEnable called before Start — but after AwakeAwake called even if disabled — Start only when enabledGetComponent every frame is slow — cache in Awake or StartGetComponentInChildren searches recursively — expensive on deep hierarchiesTryGetComponent returns bool — avoids null check, slightly fasterRequireComponent attribute — ensures dependency, documents requirementFixedUpdate, not Update — consistent regardless of framerateFixedUpdate can run 0 or multiple times per frame — don't assume 1:1Rigidbody.MovePosition in FixedUpdate — transform.position bypasses physicsTime.deltaTime in Update, Time.fixedDeltaTime in FixedUpdate — or just use deltaTime== null returns true, but object exists?. doesn't work properly — use == null or bool conversionDestroy doesn't happen immediately — object gone next frameDestroyImmediate only in editor — causes issues in buildsStartCoroutine needs MonoBehaviour active — disabled/destroyed stops coroutinesyield return null waits one frame — yield return new WaitForSeconds(1) for timeStopCoroutine needs same method or Coroutine reference — string overload unreliableInstantiate is expensive — pool frequently created/destroyed objectsInstantiate(prefab, parent) sets parent — avoids extra SetParent callSetActive(false) before returning to pool — not Destroy[SerializeField] for private fields in inspector — prefer over publicpublic fields auto-serialize — but exposes API you may not want[HideInInspector] hides but still serializes — [NonSerialized] to skip entirelyCreateAssetMenu attribute for easy creation — right-click → CreateFind methods every frame — cache referencesCompareTag("Enemy"), not tag == "Enemy"NonAlloc variants: RaycastNonAllocasync/await without context — use UniTask or careful error handling