Hello everyone,
I had high hopes of being able to implement my 2D game in DOTS. Now I’ve noticed that 2D is not being pursued any further.
I don’t really understand why this very important part of Unity gets too little attention.
I would like to know if it could still be supported for version 1.0 or if I need a completely different approach now.
I would appreciate an answer because it also depends on the further future of my game.
Thanks for your answer.
Apart from the physics, no real rendering of sprites works either.
I’m wondering if it’s worth waiting or if I have to go a completely different route.
Right at this moment I’m developing sprite rendering solution for dots. The main part done, but some features like layering aren’t there yet. Also solution currently only supports Entities 0.51.1 and have no example project, but currently I’m working on it (basic documentation exists though). You can search similar solutions here on forum, which might be even more suitable for you, but I was targeting maximum flexibility while developing.
There is old thread which might be helpful also and provide another rendering solution.
Render as quads for now, its not great but its something. Back in the day before unity supported sprites, everything was quads and people managed, I am sure you will get by until official support arrives
Exactly. The sprites are not rendered correctly. Without proper 2D graphics and physics support, DOTs doesn’t do much for me. I’m already reaching my limits in my project. Hopefully it’s being worked on.
Since you can use whatever shader and render pipeline compatible with GPU instancing - yes while mobile supporting those things. But there is a big question how DOTS and IL2CPP works with your target devices and unfortunately there is a bug in 0.51.x and maybe still on 1.0.x which described in this thread , so I can’t even test it on mobile platform, because can’t build (using subscene isn’t necessary for my system, but whole project uses subscene, so it will take a time to switch to regular scene approach).
How are sprites not rendering correctly? I use a hybrid workflow without too many issues. For animated sprites i spawn GameObjects as representation of my simulation Entities to be able to use the 2DAnimation Package and for static ones or moving ones without animation (like some of my projectiles) just placing entities into the scene works fine. Physics wise i just use the 3D physics in a 2D world (though my game is 2.5D)
Sorry I was only referring to the Sprite Renderer component.
I have no experience in 3D, but if I can do all the 2D functions there, I should switch there.
Anyway, thanks for all the tips. I’m excited to see what I can achieve with it.
I am working on 2D game with entities, too. SpriteRenderer is working fine with entities. Put the SpriteRenderer on gameObject in your sub scene, and it will automaticially become a Component, and do its render job. But I think the further problem is how to do animation? Because animator is ignored for now. I don’t know there is an official way to play animation clip for now.
In 0.17 entities all happens is for particular components implemented conversion system which just do GameObjectConversionSystem.AddHybridComponent(Component /*monobehaviour here*/). After that mono exists on specially created gameobject for converting entity with this component. You can do the same thing with any component you want and then deal with it through regular Entities syntax (without any burst and threading of course). I don’t know is it workable solution for 0.51.x and 1.0+. In 1.0+ conversion was reworked and named “Baking”, I’ve not seen it yet, so can’t comment.
I have now created a 3D project with DOTs (2022.2.0b15)
Then I created a subscene with two different game objects. One has the sprite renderer component, the other is a quad with mesh renderer.
I provided both with a sprite.
Here’s what happens when I change the position at runtime:
First of all, the position is rendered correctly. But as soon as I interact with the editor, the object jumps to the starting position with the Sprite Renderer component and no longer renders the new position. The quad, on the other hand, seems to continue to work.
For a hybrid approach, I wanted to install the 2D animation package, but I also get an error message there.
Editing Authoring Data at runtime is not really ready yet. Make sure you have SubScenes closed if you see weird behaviour.
Yes the new Collections Package is not yet compatible with the 2DAnimation package. I had to modify the 2DAnimation Package to make it work (it was like 3 really small changes). I reported this to Unity already to make sure the next 2DAnimation Package version is compatible.