PeterBacall

Hi, I never got an answer for this one. Still having problems.

Is the button in Unity "Create Hinge Chain" in the Inspector under "Skeleton Utility Bone" supposed to create a 3D hinge joint, instead of a 2D? The "Skeleton Ragdoll 2D" is creating it's joints in 2D, and I think the "Create Hinge Chain" should too.

It also gave a warning when the player flips:
BoxColliders does not support negative scale or size.
The effective box size has been forced positive and is likely to give unexpected collision geometry.
If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path "Player/Graphics/Barney Spine/SkeletonUtility-Root/root/Body/Chain"
(with the skeleton.FlipX script)
I suppose it wasn't expecting a 3D BoxCollider

For me, it makes more sense having 2D joints. Why is it 3D?

Thanks in advance,
/Peter
PeterBacall
Posts: 57

Pharan

There was some irreconcilable behavior using 2D at the time when Skeleton's hinge chain was implemented a few years ago.

We'll see if it's not too hard to convert the existing code, and if it has no problems.
User avatar
Pharan

Pharan
Posts: 4950

PeterBacall

I see, I’ve been doing my joints manually and what I know they seem to work.

Thank you, let me know when it is available
PeterBacall
Posts: 57

Nate

I think 3D hinges were used because flipping didn't work well with 2D hinges. With 3D, faux flipping can be had by rotating 180 degrees around the Y axis.
User avatar
Nate

Nate
Posts: 7976

Pharan

There doesn't seem to be a straightforward way to make this work with SkeletonUtility in the case where you flip the 2D joints.
They do in fact go nuts when you do this. You can test it yourself with HingeJoint2D's and then scaling your parent transform.

It works fine otherwise, which I think would be useful for non-character things.

I'll be adding in the code for HingeJoint2D but it'll have to be opt-in so the user knows what they're getting into.
User avatar
Pharan

Pharan
Posts: 4950

PeterBacall

Sorry for repeating the obvious, just making clear, so there is no way to flip a character with hinge joints?
Thank you for taking your time with this.
PeterBacall
Posts: 57

Pharan

If you can flip 2D hinge joints without causing them to malfuction (regardless of spine), we can try to adapt it to how SkeletonUtility works.
But SkeletonUtility on its own already works in a specific way so we can't be 100% sure on it.
User avatar
Pharan

Pharan
Posts: 4950

PeterBacall

I'll be adding in the code for HingeJoint2D but it'll have to be opt-in so the user knows what they're getting into.
Hello! Did you ever add this? Would be very useful when you are not flipping the character but want 2D colliders & hinge joints, for example interactive trees or flags or traps/doors etc. It's still making those 3D colliders and joints :-(
Thanks in advance!

hinge2D.png
PeterBacall
Posts: 57

Pharan

We haven't added this. I just tried the 2D code again to test with something else the other day and it wasn't behaving as expected, even without flipping. We need to review it again before making it available.

In the meantime, making the hinge chain manually is probably still the most reliable way for the user.
User avatar
Pharan

Pharan
Posts: 4950


Return to Unity