Search Unity

Entities converted from prefab are not rendered

Discussion in 'Graphics for ECS' started by Deadcow_, Aug 9, 2019.

  1. Deadcow_

    Deadcow_

    Joined:
    Mar 13, 2014
    Posts:
    135
    I tried the ECSSamples and all works fine there, but when I trying to use the same code to spawn entities in my game they are not rendered.
    The same result, strangely, I got when I tried to copypaste ECSSamples into my project, official samples didn't render a thing.
    Maybe I missing something and there is some project setting or something...

    So I do this three things to instantiate entity. No difference with "Spawner from MonoBehaviour" example:
    prefab = GameObjectConversionUtility.ConvertGameObjectHierarchy(Prefab);
    var entity = manager.Instantiate(prefab);
    manager.SetComponentData(entity, new Translation {Value = position});

    The problem is, actually, that in my project I got this:
    2019-08-09_09-37-37.png
    and in sample project entities looks like this:
    2019-08-09_09-37-48.png

    My prefab is a simple sphere object:
    2019-08-09_09-39-04.png
     
    SoulBruteflow likes this.
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Do you have the Hybrid Renderer (com.unity.rendering.hybrid) in your project?
     
    CabronX, timothy_j and SoulBruteflow like this.
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    Nope.
    I use Unity.Rendering (for later changing materials) and Unity.Transforms respectively.
    Does Hybrid Renderer helps with anything?

    Edit:
    Oh I realized that @tertle responded to @Deadcow_ sorry.
     
    Last edited: Aug 9, 2019
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Just a note, Unity.Rendering is the namespace of the Hybrid Render package.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,776
    Oh, that interesting.
    I suspect, it may be moved away at some point in future, as DOTS evolves?
     
  7. Deadcow_

    Deadcow_

    Joined:
    Mar 13, 2014
    Posts:
    135
    Thanks! I probably missed that part about Hybrid Render in docs. Sorry for bothering :)
     
  8. CabronX

    CabronX

    Joined:
    Oct 7, 2020
    Posts:
    1
    I just had the same problem and by adding com.unity.rendering.hybrid solved the issue
     

    Attached Files: