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.

Resolved Text Renderer (Tiny) Error when building WASM

Discussion in 'Project Tiny' started by Zindea, Nov 4, 2020.

  1. Zindea

    Zindea

    Joined:
    Mar 8, 2015
    Posts:
    25
    Im getting this error when building a scene with a TextRenderer included that I am trying to update.
    The text doesnt update in the editor.

    Here is my script:
    Code (CSharp):
    1. [UpdateAfter(typeof(TransformSystemGroup))]
    2.     public class ScoreUpdateSystem : SystemBase
    3.     {
    4.         protected override void OnUpdate()
    5.         {
    6.             var race = GetSingleton<SkateSession>();
    7.             float score = race.Score;
    8.  
    9.  
    10.             Entities.ForEach((ref Entity ent, ref ScoreText text, ref TextRenderer font) =>
    11.             {
    12.                 if (!HasComponent<Disabled>(ent))
    13.                 {
    14.                     TextLayout.SetEntityTextRendererString(EntityManager, ent, $"{score}");
    15.                 }
    16.             }).WithoutBurst().Run();
    17.         }
    18.  
    19.     }
    And the error I am getting:
     
  2. Zindea

    Zindea

    Joined:
    Mar 8, 2015
    Posts:
    25
    nvm fixed it by removing the Entity.Foreach