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.

Question Tiny2D: Changed namespace, system not running anymore

Discussion in 'Project Tiny' started by LudumFactorem, Nov 26, 2020.

  1. LudumFactorem

    LudumFactorem

    Joined:
    Jan 23, 2015
    Posts:
    24
    Hello,

    I am a beginner with DOTS/Tiny Project and have a simple problem but I'm stuck on this.

    I download Tiny Project 0.31, launch properly the Tiny2D project, run it, all is fine (the hexagon rotates as intended).

    I open the RotationSpeed component and the RotationSystem system, change the namespace from Tiny2D to Tiny2DD (it's an example), compile it, run it, and the hexagon does not rotate anymore. If I manually change again the namespace to Tiny2D, it works again.

    I tried to breakpoint, RotationSystem's OnUpdate method is called with the Tiny2D namespace but no with another one.

    Any help please?
     
  2. LudumFactorem

    LudumFactorem

    Joined:
    Jan 23, 2015
    Posts:
    24
    Precision: If I only change the namespace of the system, or if I add other systems with any namespace I choose, it works. But if I change the namespace of the component, the systems won't run again.
     
  3. NagaChiang

    NagaChiang

    Joined:
    Sep 17, 2020
    Posts:
    13
    I tried to reproduce the issue by renaming the namespace of RotationSpeed and fixing the reference in RotationSystem, but it worked pretty well rotating the hexagon in the editor (with 2D Entities) and Asmjs build.

    My wild guess is that you might duplicate the scripts and somehow the system queries for the component different from the one actually in the scene.
     
  4. LudumFactorem

    LudumFactorem

    Joined:
    Jan 23, 2015
    Posts:
    24
    Thank you for your help. I didn't test with the Asmjs build, and indeed it works well with it. My problem occurs with Win-DotNet and Win-IL2CPP builds.
     
  5. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    848
    @LudumFactorem I had a check with the authoring team, and what you have stumbled on is a bug that will be fixed in a future version of the Entities package. The issue is that the conversion system does not detect a change with your component data, and does not re-serialize that piece of data when creating the ECS data blobs.

    In the meantime, you can move over to using GameObjectConversionSystem. See a "Hello world" example of it here. Do note that you should also use the [ConverterVersion]-attribute with your conversion systems in order to help the conversion system detect changes with your authoring data.