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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How can i get runtime vertices in 2d animated sprite?

Discussion in '2D Experimental Preview' started by Yeung, Jul 15, 2019.

  1. Yeung

    Yeung

    Joined:
    May 31, 2013
    Posts:
    2
    Hey guys,
    I have a sprite that was animated by adding bones and geometry with 2D animation version 2.0.0. The sprite is animating great and now i want to add collider to my sprite. But i find that the sprite.vertices are not updated during runtime, which are the initial vertices of the sprite.

    How can i get the vertices positions during runtime?

    Thank you for your help!
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    It is not possible with the version of 2D Animation you are using unfortunately.

    We will expose this in a future version.
     
  3. Kidara

    Kidara

    Joined:
    Jul 6, 2017
    Posts:
    16
    Up, is it now possible?
     
  4. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    156
  5. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    434
  6. stickylab

    stickylab

    Joined:
    Mar 16, 2016
    Posts:
    88
  7. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    883
    We do not have any examples of this. Could you share with us where you are currently stuck @afakul?
     
  8. dikar771

    dikar771

    Joined:
    Oct 30, 2015
    Posts:
    19
    Hey,

    Just tried to get vertices with GetDeformedVertexPositionData() in Update method and assign positions to test spheres: spheres moves in another direction than sprite with real vertices. How can I get global vertices positions?
     
  9. dikar771

    dikar771

    Joined:
    Oct 30, 2015
    Posts:
    19
    Solved. It seems that GetDeformedVertexPositionData() returns localPositions relative to SpriteSkin's transform. Perhaps this should be reflected in the documentation