- Изменено
How to reset attachments on skeleton
Hey, I'm pretty new to spine. I've pretty much followed the starting guide and read though the examples.
I have a skeleton with many animations. The default animation has no weapons, but the attacking animation has weapons on the hands.
When I change the animation using SetAnimation to an animation with weapons, the weapons stay when I go back to the default weaponless animation.
How do I reset it so that the skeleton is no longer holding the weapons?
Some material to read about this would also be nice.
Thanks
Spine runtimes currently have a "hands-off" behavior by default.
That means anything that wasn't keyed, won't change. So if you didn't key the weapons to be hidden, they won't be hidden.
There are changes coming to the code that has ready-code to match the editor more closely, as well as other new features: [runtimes] AnimationState improvements · Issue #621 · EsotericSoftware/spine-runtimes · GitHub
That mode won't be as flexible but it will be what people need if they intend to do mostly typical animations.
You can read more about this at the bottom of the first post here: Noteworthy Spine-Unity Topics
There is also a temporary implementation of the new AnimationState.cs code. Note that it's "unofficial" and its API is a bit different from the final.