Is it possible to move a transform to a specific point on a sprite animation every frame?

I’ve spent the past couple of days trying to figure out a way to move a transform to match a moving point on a sprite animation drawn frame by frame. The transform would move to a new point on the animation each frame so that the characters head can animate independently of the body.

Just wondering if anyone knows of any paid software or good tricks for achieving this? This locator system would be perfect: Sprite Factory - Locator System - YouTube but doesn’t use the modern Unity animation system.

I’ve looked into using animation events but have found them quite difficult to work with/ unreliable so far.

Ideally I’m looking for something like the pivot in the sprite editor, but a whole separate one just for attaching child objects to each frame. I wouldn’t mind doing some time-consuming typing in of offsets for each frame if it would work quickly enough.

Thanks very much!

Romano

EDIT:

My current solution is to use the sprite from the sprite renderer as a key in a dictionary which equals the desired point on the sprite as a vector2. It’ll take ages doing it this way, and I don’t know what impact checking the dictionary every frame of the animation will have on the performance so would still appreciate advice from anyone on how I can do this better.

That looks like he’s just put some empty GameObjects as children of the main sprite GameObject. So when the thing moves they travel along. Then just tied a particle effect to each one.

You could create a custom Animation for each of these GameObjects that you could set to only last x frames. I’m not sure they would be perfectly timed though. To do that you would just select the GameObject for the foot, press ctrl+6 then add a new curve, and edit the keyframes. It sounds a lot harder than it is. Video tutorial for the Animation Panel: 1