- تم التحرير
[Unity] Ragdoll. Nuff said.
Nightmare fuel.
Just saw the Git checkins and had to come look at this. Super rad work, Mitch and Pharan!
Cool stuff
Very nice, probably use it for a training area where the hitting dummy will be standing Thanks for this one.
Praise be to Mitch, and glory upon his head! :yes:
Brilliant.
Im trying to use it with a character that has been scaled and the scale breaks things - I see the radgoll rigidbodies flying around and the body doing only a fraction of the movement. Sometimes the ragdoll objects fly through things.
Is there a known workaround before I spend a week trying to figure it out?
Thanks,
Yohami
I just tested using localScale.x -1 which is common for flipping a character and that also breaks the ragdoll
Changing the scale breaks Unity's Physics stuff. This is a Unity thing. Not a Spine thing.
Pharan wroteChanging the scale breaks Unity's Physics stuff. This is a Unity thing. Not a Spine thing.
Scale of negative 1 is not common at all for flipping physics based characters because it destroys most physics simulations in one way or another. However, if you dont adjust the scale after calling the Ragdoll() function it should adapt correctly to whatever scale it was set to.
Hi Mitch, thanks for the response.
"Scale of negative 1 is not common at all for flipping physics based characters because it destroys most physics simulations in one way or another."
I was reading the documentation and maybe the proper way to do the direction flip is doing FlipX, I'll try that.
"However, if you dont adjust the scale after calling the Ragdoll() function it should adapt correctly to whatever scale it was set to."
It doesnt, it just breaks if the scale is set to anything but 1. Try the ragdoll example, change the scale of one of them, press play and test the ragdoll, it gets crazy.
Im using scaling for several reasons. One is to have the main character at higher resolution because I do close ups sometimes, and I dont want him to look jaggy. The other is to have several enemies of the same type where I have bigger and smaller ones, with the bigger ones being tougher.
Let me know if there's a workaround for that - otherwise I might just do several duplicated skeletons at different sizes.
Thanks.
Just a tangential tip:
For the main character, select its SkeletonDataAsset
in the project and change the Scale
field there, so it scales the data on import, not the transform.
This way, you can have a Transform in game with a clean scale (and also reap whatever other performance and workflow benefits that has).
Pharan, thanks, that did it.
Using the Scale in the SkeletonDataAsset plus FlipX in the SkeletonUtility covers my use cases, so I can have ragdolls without having to code everything myself from scratch, which is amazing.
Gonna send you a copy of the game when its ready, in the meantime Im posting progress here http://www.twitter.com/yohami
Oh it did? That's great! Glad to hear it.
I'm having some strange ragdoll issues. All of my limbs have large gaps between them. My skeleton is scaled at 1 and I've just adjusted the skeleton_data asset to .003, that is pretty small, perhaps that is part of my issue?