docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Enableable components introduction

    You can use enableable components on IComponentData and IBufferElementData components to disable or enable individual components on an entity at runtime. To make components enableable, inherit them from IEnableableComponent.

    Enableable components are ideal for states that you expect to change often and unpredictably, or where the number of state permutations are high on a frame-by-frame basis. Adding and removing components is the preferable way to manage components for low-frequency state changes, where you expect the state to persist for many frames. You can use enableable components to avoid structural changes in some situations. For more information, refer to Manage structural changes with enableable components.

    You can also use enableable components instead of a set of zero-size tag components to represent entity states. This reduces the number of unique entity archetypes, and encourages better chunk usage to reduce memory consumption.

    Additional resources

    • Use enableable components
    • Look up arbitrary data
    • Manage structural changes with enableable components
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)