Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Generating Prefabs Dynamically based on Index in DOTS

Discussion in 'Entity Component System' started by Dog_Like, Jul 31, 2023.

  1. Dog_Like

    Dog_Like

    Joined:
    Nov 24, 2017
    Posts:
    25
    I've got a question about dynamically generating prefabs based on their index. I've got a bunch of prefabs, and each one has a unique index. How can I bake these entities in DOTS, so that I can efficiently access them during runtime using their corresponding index?
     
  2. Dog_Like

    Dog_Like

    Joined:
    Nov 24, 2017
    Posts:
    25
    Resolved by dynamic buffer.
     
  3. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    943
    Check this article. Store the entity prefab on your dynamic buffer.