wave6-baker-set-component-enabled

Sets the initial enabled state of an IEnableableComponent during DOTS bake time.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave6-baker-set-component-enabled
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wave6-baker-set-component-enabled
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/wave6-baker-set-component-enabled
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave6-baker-set-component-enabled

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Eliminates runtime “first-frame” conditionals by letting you define whether an IEnableableComponent starts enabled directly during DOTS baking.

Core Features & Use Cases

  • Bake-Time Initialization: Uses Baker.SetComponentEnabled<T>() to ensure the component is present but inactive (or active) from the moment the SubScene loads.
  • Correct Baker Ordering: Ensures you add the component first (AddComponent<T>) and then set its enabled state to avoid exceptions.
  • Authoring-Driven Variability: Supports per-instance initial state driven by authoring fields (e.g., a bool that varies per prefab/scene instance).

Quick Start

Ask the AI to “show me the correct Baker pattern to add Carry and set it disabled at bake time based on a BallAuthoring.startCarried flag.”

Frequently Asked Questions about wave6-baker-set-component-enabled

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set the initial enabled state of an IEnableableComponent during Unity ECS baking?▼

To set the initial enabled state during Unity ECS baking, use Baker.SetComponentEnabled<T>() after calling AddComponent<T>(). This ensures the component is present but inactive or active from the moment the SubScene loads, eliminating runtime first-frame conditionals.

Why does Baker.SetComponentEnabled throw an exception when adding a new component in Unity DOTS?▼

Baker.SetComponentEnabled throws an exception if the component does not exist on the entity yet. You must call AddComponent<T>() before invoking SetComponentEnabled<T>(entity, enabled) to correctly establish the component before modifying its state.

Can I vary the initial enabled state of a component per authoring instance in Unity SubScenes?▼

Yes, you can vary the initial enabled state per authoring instance. By reading authoring fields, such as a boolean flag, your baker can dynamically pass the enabled boolean to SetComponentEnabled<T>() during the baking process for each specific prefab or scene instance.

What is the best way to avoid runtime first-frame conditionals for disabled components in Unity DOTS?▼

The best way to avoid runtime first-frame conditionals is to define whether an IEnableableComponent starts enabled directly at bake time. Using Baker.SetComponentEnabled<T>() initializes the component's state correctly before the SubScene loads at runtime.

Do I need to reimport the SubScene to reflect authoring changes for component enabled states?▼

Yes, you need to reimport the SubScene to reflect authoring changes. The DOTS baking process relies on SubScene reimport to evaluate the baker and apply the updated SetComponentEnabled<T>() states based on modified authoring instances.