Hey Harald and everyone, hope your holidays & New Year went well!
I finally got the chance to take a look at the 'issue' I had mentioned in my post a month ago. Turns out it seems to all boil down to one thing - not understanding how the "wind" and "gravity" values that are set/keyed in a Spine animation get translated to how they actually appear in Unity. Note: I did most of my testing with "wind" and not "gravity" so I'll just focus on "wind" since I think they operate in a similar fashion.
In my test project I set up a hanging banner (like a flag) that hangs straight downward. It's mesh is bound to a chain of bones. I created an animation that has a single key, which is the "Wind" being set to 30.
- In Spine, the Wind value causes the banner to be rotated clockwise over 45 degrees (so its pointing towards the right)
- However, in Unity the banner is barely angled at all. It's basically pointing straight downward.
I noticed that if I cranked up the Wind to a ridiculous value, it did affect how it looked in Unity, but way less, as though it was scaled down a bunch. So I thought it might be something related to "unit values" (ie. Spine units versus Unity units, or something like that). I tried changing the "Scale" on the SkeletonData.asset from the default value of 0.01 to 1. This did indeed help (how it looked in Unity became closer to how it looks in Spine), but it still isn't correct. It was still off by a factor of 2, or something around that.
- Is there some sort of "unit-value scaling" that I need to set on the Unity project to make it look the same in Unity as it does in Spine?
- Once I get question #1 figured out, I'd like to be able to test out applying my own Wind to SkeletonAnimations though code. Any tips on how this can be done? Ultimately what I'd like to test out is setting up my weather system in-game where it sets the Wind value on the SkeletonAnimation based on the position of the character in-game (aka each frame my weather system would calculate how strong the wind is at the location the character is standing, and apply it to the SkeletonAnimation). My ultimate goal is to have my weather system handle in-game gusts of wind, etc, including temporary bursts of wind from other characters doing things like slamming their weapon down on the ground nearby
- Just wanted to check - is there any documentation for physics with either the Spine Editor of the Unity Runtime? Guessing not since it's still beta and is still changing, but just want to verify since right now I'm learning purely by testing
Thanks for any help!