- Home /
Can I change a SpriteMask sprite in an animation?
I have an object that is using a different sized sprite during certain animations, and this object needs to mask other sprites it overlaps with. Normally it is 16x16 pixels, so my SpriteMask is also using a solid 16x16 texture to mask the entire area. For turning animations it will either grow to 16x32 or 32x16, and I need the SpriteMask texture to match this.
Now I can manually update the SpriteMask's sprite in the inspector and it works great, but the animator does not detect this as a property when I am recording this change.
The only alternative I can think of is using StateMachineBehaviour to change the sprite in code in OnStateEnter() & OnStateExit() methods. Any other ideas?
I am in the same situation :/ .. Looks like I have to create multiple Sprite$$anonymous$$asks and Activate/Deactivate them through the Animation instead of just changing the Sprite