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 [Solved] Unity 2020.3.0f1 problem with 2D Entities

Discussion in 'Entity Component System' started by Ismaeel370, Apr 16, 2021.

  1. Ismaeel370

    Ismaeel370

    Joined:
    Mar 16, 2015
    Posts:
    11
    I am facing an error that I can't figure to resolve with 2D entities package. I am using Unity 2020.3.0f1 and after installing 2D Entities (com.unity.2d.entities) package if I play my scene I get the following error and can't figure out the cause of it. It goes away if I remove 2D Entities (com.unity.2d.entities) package from my project.

    Code (CSharp):
    1. ArgumentException: A component with type:EditorRenderData has not been added to the entity.
    Attaching the screenshot of the error. I will add the complete stack trace in case someone wants to know.
     

    Attached Files:

  2. Ismaeel370

    Ismaeel370

    Joined:
    Mar 16, 2015
    Posts:
    11
    I fixed this problem.

    How I fixed is as follow:
    Used the sub scene workflow for the conversion of the gameobjects to entities. Previously using convert to entity script component.

    Cause:
    com.unity.2d.entities(U2D) package with Unity 2020.3.0f1. Face error only when I installed this package and used the convert to entity script component on required game object.

    Requirement:
    I had to use SpriteRenderer from Unity.U2D.Entities.

    I know a lot of ECS packages are in preview and still not production ready. I am sharing how I was able to fix the error shared above.
     
    Antypodish likes this.