I’m trying to find I way to get the sprite’s pixel position (as position of a given pixel of the given frame in the sprite image) in the world coordinates in the scene when the given sprite is used. If I could access the pivot point of each frame of the sprite and also pixel-to-unit ratio, it’ll be quite easy. But none of this is exported in the API. And I would need it at the runtime. Is there some another way to find the sprite pixel position in the world?
How about just animating empty child gameObject position to “follow” that pixel position on each frames, if its always the same pixel? (using animation window)
mgear,
Yes that will work of course but as first I have to find the position where this empty game object should be placed, and that’s the main problem (I don’t want to do any manual work because of lot of the data). I’ve a got a lot of sprites and with them I’ve some data generated (where I’ve got some some pixel position changes over frames, etc) which should be then used in runtime. I don’t want to manually process this data for every sprite. Just pretend we don’t have any animations here for now as it simplify the problem a bit.
Maybe I could prepare some prefabs on import and then used somehow but I don’t like this option much