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.
  2. Dismiss Notice

Question How can I convert sprite sheet into material

Discussion in 'Entity Component System' started by iamshenkui_gee, Jul 21, 2022.

  1. iamshenkui_gee

    iamshenkui_gee

    Joined:
    Apr 24, 2021
    Posts:
    30
    Hi, I am trying to add animations to my ECS game. I found the code monkey's video used material and mesh to realize the function. But I am unsure how I can convert a sprite sheet to a material?
    Also, is there any other method I can use to add animation to the entity in ECS/DOTS?
     
  2. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    262
    ShaderGraph has a Flipbook node. This can be used to create a flipbook animation.

    In Entities 0.50 and up (even with the coming 1.0) will not have an animation package. (0.17 did, should you be on the old version, but I guess the code wont be updated much)

    You can have the animation run on old unity and use a ComponentObject. Then you have access to all the normal unity animation tools, but no benefit from fast DOTS. I have not tried this myself.

    There was a GPU based animation technique that packed all the vertex movements in a texture... but no idea if this is still a viable solution. Also not tried myself.

    There are probably more options :).
     
    iamshenkui_gee likes this.
  3. iamshenkui_gee

    iamshenkui_gee

    Joined:
    Apr 24, 2021
    Posts:
    30
    So, at this time, Entities will not provide animation tools since I am using Entities 0.51.
    And using the old animation system and blender tree and converting them to entities will be the easiest way, right?

    I will try whether flipbook could work for me.

    Thank you!
     
  4. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    262
    in 0.51 it is not just the tools, the entire dots animation package is not supported.

    So to get skinned mesh animation, using the old system might be the easiest way to get something up and running. Technically you are not converting them to entities, you are linking a normal gameobject to an entity. And you are abel to influence this normal gameobject from a system in a easy way.

    This framework also has a Skinned Mesh solution. Maybe it can help with your use case, but i have not looked at it myself.
    https://forum.unity.com/threads/0-5-3-my-personal-dots-framework-latios-framework.797685/