Is there a way to animate my GPU instanced mesh?

i created a GPU Instanced script that can draw 1000+ mesh

The problem is they dont do anything :frowning: how can i animate these instanced meshes

my code:

void Update ()
    {
        for (int i = 0; i <= instanceCount - 1; i++)
        {
            Graphics.DrawMesh(skmesh.sharedMesh, instancePos[i], Quaternion.identity, skmesh.material, 0, null, 0, null, false, false);
        }
       
    }

thank you in advance :smile:

Thatโ€™s the same thing Iโ€™m currently working on.

Iโ€™m no expert at all but as I understood it you have to extract the animation data from your clip (the one you use in the animation controller) save it in some runtime readable format (for example a ScriptableObject) and when you want to play a specific animation past these data to a shader in order to move the mesh.

As of now I managed to save the animation data but Iโ€™m facing some problem with removing some hardcoded stuff and Iโ€™m fighting against some weird animation importing behaviour specified in my last thread.

Take a look here : How does UEBS get a million troops on the field simultaneously? - Industries - News & General Discussion - Unity Discussions

This may help