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. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Deform Sprite Skin using scripting

Discussion in '2D Experimental Preview' started by brandav, Apr 28, 2020.

  1. brandav


    Sep 5, 2016
    Is it possible to deform a Sprite Skin using scripting? I have a prefab with Sprite Renderer and Sprite Skin components, and I am assigning the Sprite during runtime. I'd like to manually deform the sprites, and I have attempted to use both:
    Code (CSharp):
    1. spriteRenderer.sprite.SetBones(spriteBones);
    Code (CSharp):
    1. spriteRenderer.sprite.SetVertexAttribute(VertexAttribute.Position, positions);
    It seems like it's only possible after the Create Bones button is clicked on the Sprite Skin component in the inspector, but this is not accessible at runtime. Am I missing something?