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. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deform Sprite Skin using scripting

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

  1. brandav

    brandav

    Joined:
    Sep 5, 2016
    Posts:
    7
    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?