Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug ScreenToWorld System error

Discussion in 'Project Tiny' started by MAyahmay, Jul 2, 2020.

  1. MAyahmay

    MAyahmay

    Joined:
    Jun 22, 2020
    Posts:
    5
    I have Issue with ScreenToWorld System. I try to Get it but by calling
    World.GetExistingSystem<ScreenToWorld>();

    it return null and when I try to get or Create it by
    World.GetOrCreateSystem<ScreenToWorld>();

    it cause "InvalidOperationException: GetSingleton<Unity.Tiny.DisplayInfo>() requires that exactly one Unity.Tiny.DisplayInfo exist that match this query, but there are 0." I try to Use
    RequireSingletonForUpdate<DisplayInfo>();

    but when I call this function from OnCreate OnUpdate is never called.
     
  2. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Some stuff is only available on the build, DisplayInfo is one of those. You will want to either build your game to test, or create an editor-only logic in some parts to be able to continue testing on the editor.
     
  3. FDMpro

    FDMpro

    Joined:
    Aug 19, 2014
    Posts:
    14
    I try to build and test it there (build for Web Wasm) but Same error come in Browser too
     
  4. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    weird do you have tiny rendering settings in your build config
    also in your asmdef make sure to include the following references
    "Unity.Tiny.Rendering",
    "Unity.Tiny.Rendering.Native",

    upload_2020-7-2_13-2-18.png
     
  5. MAyahmay

    MAyahmay

    Joined:
    Jun 22, 2020
    Posts:
    5
    Yes I have TinyRendering setting and both asmdef.

    but when I try to build project I got this error in Browser:

    Code (CSharp):
    1. Uncaught RuntimeError: unreachable
    2.     at il2cpp::os::CrashHelpers::CrashImpl() (<anonymous>:wasm-function[8978]:0x23837b)
    3.     at il2cpp::os::CrashHelpers::Crash() (<anonymous>:wasm-function[8976]:0x23836d)
    4.     at tiny::vm::Exception::Raise(Il2CppException*) (<anonymous>:wasm-function[8948]:0x236700)
    5.     at Assert_IsTrue_m3C5A0F83FECD21D5195ABD90373471E8D8CA2A8D (<anonymous>:wasm-function[7291]:0x16ed6c)
    6.     at ScreenToWorld_FindPickRoot_mE687989B8F92C82B0A94E3A68F740501B1556E7F (<anonymous>:wasm-function[5637]:0xf7ff8)
    7.     at ScreenToWorld_ScreenSpaceToWorldSpace_m75BBD3C7EF05AD3CC6D5869FE090421BA291B70C (<anonymous>:wasm-function[5638]:0xf80d7)
    8.     at ScreenToWorld_InputPosToWorldSpaceRay_m272AD75F0036BF1272C98848201D22A1CFEE3A1E (<anonymous>:wasm-function[5642]:0xf8e4e)
    9.     at BallInputSystem_OnUpdate_m187504DE459E0149C614A97C6D4474CB8DC95EA6 (<anonymous>:wasm-function[5424]:0xdc8e5)
    10.     at SystemBase_Update_m9ABDC8490E61C7C7A010F259C0CE94DB03F76270 (<anonymous>:wasm-function[7002]:0x15c7c1)
    11.     at ComponentSystemGroup_UpdateAllSystems_m31AE52B0FBC764D0714A09D8EDFDD5C9D52B21C8 (<anonymous>:wasm-function[6643]:0x140a3e)
     
  6. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21
    That means that for some reason the render graph is not yet built when you try to pick. Are you trying to call it in the first frame before rendering is ready?