Trying to use ScreenToWorldSystem.cs

Hello,
Im trying to run ScreenToWorldSystem.cs from the tiny example in isolation in a clean empty project but im having some trouble.

it failing on Asert Assert.IsTrue(ePickRoot != Entity.Null); // No root for picking with this id found

/// <summary>
/// Convert screen point to world point
/// </summary>
public static class ScreenToWorldSystem
{
    // Camera distance
    private const float nearClip = 6.5f;
    public static float3 ScreenPointToWorldPoint(World world, float screenPoint)
    {
        var screenToWorldSystem = world.GetExistingSystem<ScreenToWorld>();
        var worldPoint = screenToWorldSystem.ScreenSpaceToWorldSpacePos(screenPoint, nearClip);
        return worldPoint;
    }
}
public float3 ScreenSpaceToWorldSpace(float2 screenPos, float normalizedZ, ScreenToWorldId id)
{
    Entity ePickRoot, ePass;
    FindPickRoot(out ePickRoot, out ePass, id);/ !!!!!
    if (ePickRoot == Entity.Null)
        return new float3(0);
    // root and viewport transform
    var pass = EntityManager.GetComponentData<RenderPass>(ePass);
    float2 pp = InverseViewPortTransform(screenPos, pass);
    float4 pp2 = InversePassTransform(new float4(pp, normalizedZ, 1), pass);
    // now apply transform for all passes in list as well, if there is one
    if (!EntityManager.HasComponent<ScreenToWorldPassList>(ePickRoot)) {
        pp2 *= 1.0f / pp2.w; // homogenize, as we drop w here, we need to turn it into w=1
        return pp2.xyz;
    }
    var l = EntityManager.GetBuffer<ScreenToWorldPassList>(ePickRoot);
    for (int i = 0; i < l.Length; i++)
    {
        var lp = EntityManager.GetComponentData<RenderPass>(l[i].pass);
        pp2 = InversePassTransform(pp2, lp);
    }
    pp2 *= 1.0f / pp2.w; // homogenize, as we drop w here, we need to turn it into w=1
    return pp2.xyz;
}
protected void FindPickRoot(out Entity eOutPickRoot, out Entity eOutPass, ScreenToWorldId id)
{
    var ePickRoot = Entity.Null;
    var ePass = Entity.Null;
    Entities.ForEach((Entity e, ref ScreenToWorldRoot root) => {
        if (root.id == id)
        {
            Assert.IsTrue(ePickRoot == Entity.Null); // Multiple roots with same pick id found
            ePickRoot = e;
            ePass = root.pass;
            Assert.IsTrue(ePass != Entity.Null);
        }
    }).Run();
    Assert.IsTrue(ePickRoot != Entity.Null); // No root for picking with this id found // !!!!!!!!
    eOutPickRoot = ePickRoot;
    eOutPass = ePass;
}
InvalidOperationException: Assertion failed.
Unity.Tiny.Rendering.ScreenToWorld.FindPickRoot (Unity.Entities.Entity& eOutPickRoot, Unity.Entities.Entity& eOutPass, Unity.Tiny.Rendering.ScreenToWorldId id) (at Library/PackageCache/com.unity.tiny@0.31.0-preview.24/Unity.Tiny.Rendering/ScreenToWorld.cs:97)
Unity.Tiny.Rendering.ScreenToWorld.ScreenSpaceToWorldSpace (Unity.Mathematics.float2 screenPos, System.Single normalizedZ, Unity.Tiny.Rendering.ScreenToWorldId id) (at Library/PackageCache/com.unity.tiny@0.31.0-preview.24/Unity.Tiny.Rendering/ScreenToWorld.cs:132)
Unity.Tiny.Rendering.ScreenToWorld.ScreenSpaceToWorldSpaceRay (Unity.Mathematics.float2 screenPos, Unity.Mathematics.float3& origin, Unity.Mathematics.float3& direction, Unity.Tiny.Rendering.ScreenToWorldId id) (at Library/PackageCache/com.unity.tiny@0.31.0-preview.24/Unity.Tiny.Rendering/ScreenToWorld.cs:214)
Unity.Tiny.Rendering.ScreenToWorld.ScreenSpaceToWorldSpacePos (Unity.Mathematics.float2 screenPos, System.Single distanceToCamera, Unity.Tiny.Rendering.ScreenToWorldId id) (at Library/PackageCache/com.unity.tiny@0.31.0-preview.24/Unity.Tiny.Rendering/ScreenToWorld.cs:223)
Systems.ScreenToWorldSystem.ScreenPointToWorldPoint (Unity.Entities.World world, System.Single screenPoint) (at Assets/Scripts/Systems/ScreenToWorldSystem.cs:19)
Systems.InputControllerSystem.OnUpdate () (at Assets/Scripts/Systems/InputControllerSystem.cs:28)

Im not sure what im missing to make this work, is there components i need to add to a camera or scene. P

Any help would be appriciated

ok so it turns out this works in the build but not editor, so some black magic on the build side?

Playing in the editor isn’t supported in Tiny. From the Getting started guide

Play-in-Editor
Starting with preview 0.28, the Play-in-Editor (in Game view via DOTS Hybrid mode) is no longer supported and will be replaced in the future with an embedded DOTS Runtime player taking over and replacing the Game view.
You can still play some Project Tiny samples in the Editor, but some features will not work properly. For example Input requires to have “#if UNITY_DOTSPLAYER / using Unity.Tiny.Input;” and a few more ““#if UNITY_DOTSPLAYER” in your code to work in both Editor & standalone.
For now we recommend you use “Built and Run” with the Windows/Mac DotNet build configurations for the best result and still fast iteration. The Build process is incremental and relatively fast when you’ve made only small changes.
Stay tuned for further improvements in this area.

Also for future Tiny issues you should use https://forum.unity.com/forums/project-tiny.151/

Ah thank you, this make is so hard to debug. Is there any tools for seeing entities in your build ?

Not that I know of. Apparently it’s something they are working on.

Live link ?

Live Link ? for tiny Wasm build ? is this possible

I admit I’ve not used it yet but my understanding is that it’s not plateforme constrained.
Form the demo they did a while ago, being able to edit the scene and have the change replicated to the built player, I assume it has a representation of the entity world.
Hopefully you can select the built world in the entity debugger ?

tried for an hour to get it working, can’t seem to get past this
6800051--788606--Screen Shot 2021-02-03 at 6.12.28 PM.png

You really should discuss this over on the tiny forums
https://forum.unity.com/forums/project-tiny.151/
You’ll have more people who have experience with it