Can't animate SpriteShape control points?

Hello folks,

I’d like to create some animations that reshape a SpriteShape spline based on game state. I’ve tried a couple options, but none seem to work. As best I can tell, the SpriteShape control nodes are hidden from Animator/Animation components in ways that make it impossible to animate the shape of a SpriteShape using Unity’s Mecanim animation system.

This makes me sad. Am I missing something? Is there a way to do this?

Using Unity 2020.3.7 and SpriteShape 5.1.3

Process:

  • Select SpriteShape GameObject in Hierarchy.

  • Open Animation window, select desired animation from dropdown, and press record.

  • In Inspector for SpriteShapeController, click Edit Spline. Edit the spline by moving control points and adjusting tangents.

  • Turn off record button.

  • Find that nothing has been recorded: no SpriteShape-related properties in the Animation window. And when I click the Play button in the Animator window, the SpriteShape doesn’t change.

Alternate process:

  • Select SpriteShape GameObject in Hierarchy.

  • Open Animation window, select desired animation from dropdown.

  • In Animation window, click Add Property. Browse options.

  • Find that there are no control-point-related properties in SpriteShapeRenderer or SpriteShapeController

Help appreciated …

I’ve dug into this same problem and wasn’t able to completely find a solution. You can do some animation yourself via code by access the control points and moving them around with script. But that probably won’t fit what you need them for.

I needed to do the same thing, and after digging around for a solution I think that the problem partially extends from the fact that the animation timeline does not save array values. The SpriteShapeController stores each control point and such in arrays, so I believe that is at least part of the reason it does not work.

Please take a look a this excellent video for one way to Animate points :

1 Like