Search Unity

Discarding transform information from entities that don't need it.

Discussion in 'Entity Component System' started by DanSuperGP, Jul 11, 2020.

  1. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Is there a good way to remove the LocalToWorld, Rotation, and Translation components that are automatically generated from game objects in a Subscene or converted with the ConvertToEntity script?

    Many of the entities I'm creating don't need that data. Were I working with a MonoBehaviour based work flow I probably would create them as ScripableObjects.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Add the StaticOptimizeEntity component (monobehaviour) to objects and they won't be given rotation/translation (note they'll still have a localtoworld that's been calculate at conversion but it won't be updated/cost anything to maintain)
     
    Opeth001 and DanSuperGP like this.
  3. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Thanks, that's exactly what I was looking for.